Fan run faster on linux laptop Dell

Fan run faster on linux laptop Dell

Using Git on Ubuntu

Using Git on Ubuntu use ssh

  • Install git

    sudo apt-get install git
  • Setup file hosts if you use git in LAN network

    gedit /etc/hosts

    Add ip local git’s: ip domain example: 192.168.0.101 git.mv

  • Get SSH key

    ssh-keygen -t rsa -b 4096 -C "your email"

    Copy SSH key

    gedit /home/username/.ssh/id_rsa.pub

    Access website then paste ssh key

Quote

Guide install lamp(Linux-Apache-MySQL-PHP)

  • Config proxy Ubuntu(If your network using proxy)

    sudo nano /etc/environment

    PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/$

    http_proxy="http://username:password@address:port/"
     https_proxy="https://username:password@address:port/"
     ftp_proxy="ftp://username:password@address:port/"
     socks_proxy="socks://username:password@address:port/"
  • sudo nano /etc/apt/apt.conf || sudo gedit -H /etc/apt/apt.conf

    Acquire::http::proxy "http//username:password@address:port/";
     Acquire::https::proxy "https://username:password@address:port/" ;
     Acquire::ftp::proxy "ftp://username:password@address:port/" ;
     Acquire::socks::proxy "socks://username:password@address:port/" ;
  • apache2

    sudo apt-get install apache2
  • mySQL

    sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
    
  • PHP

    sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    
  • mySQL-Workbench

    sudo apt-get install mysql-workbench
    

Win32

  1. What is Handle ?

Handle and Objects

An object is data structure the represents a system resource , such as a file, thread or graphic image .An application can’t directly access object data or system resource that an object represents. Instead , an application must obtain an object Handle , which it can use to examine or modify the system resource . Each handle has an entry in an internally maintained table. The entries contain the addresses of the resources and means to indentify the resource type.

Microsoft reference

Stack and Heap

Stack:

  • Stored in computer RAM just like the heap.
  • Variables created on the stack will go out of scope and automatically deallocate.
  • Much faster to allocate in comparison to variables on the heap.
  • Implemented with an actual stack data structure.
  • Stores local data, return addresses, used for parameter passing
  • Can have a stack overflow when too much of the stack is used. (mostly from infinite (or too much) recursion, very large allocations)
  • Data created on the stack can be used without pointers.
  • You would use the stack if you know exactly how much data you need to allocate before compile time and it is not too big.
  • Usually has a maximum size already determined when your program starts

Heap:

  • Stored in computer RAM just like the stack.
  • Variables on the heap must be destroyed manually and never fall out of scope. The data is freed with delete, delete[] or free
  • Slower to allocate in comparison to variables on the stack.
  • Used on demand to allocate a block of data for use by the program.
  • Can have fragmentation when there are a lot of allocations and deallocations
  • In C++ data created on the heap will be pointed to by pointers and allocated with new or malloc
  • Can have allocation failures if too big of a buffer is requested to be allocated.
  • You would use the heap if you don’t know exactly how much data you will need at runtime or if you need to allocate a lot of data.
  • Responsible for memory leak.

 

 

When to use the Heap?

When should you use the heap, and when should you use the stack? If you need to allocate a large block of memory (e.g. a large array, or a big struct), and you need to keep that variable around a long time (like a global), then you should allocate it on the heap. If you are dealing with realtively small variables that only need to persist as long as the function using them is alive, then you should use the stack, it’s easier and faster. If you need variables like arrays and structs that can change size dynamically (e.g. arrays that can grow or shrink as needed) then you will likely need to allocate them on the heap, and use dynamic memory allocation functions like malloc(), calloc(), realloc() and free() to manage that memory “by hand”. We will talk about dynamically allocated data structures after we talk about pointers.

Example exaplain