gsettings set org.gnome.settings-daemon.plugins.power critical-battery-action 'nothing'
gsettings set org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power critical-battery-action 'nothing'
gsettings set org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
sudo fdisk -l
dd if=/path-to-iso of=/dev/sd? sync
dd if=/home/me/ubu.iso of=/dev/sdc sync
#include "stdafx.h"
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
int c;
srand(time(NULL));
while(1)
{
cout<<rand();
}
return 0;
}
Lets have an in depth look at the code. The actual random numbers are generated by the rand() function. The numbers that it generates are not random but are pseudorandom i.e. they appear to be random but are not. In actual the rand() function generates a predictable series of numbers. The series however can be initialized with a seed value which in the above code is being done using the srand() function. The srand() needs only be called once during a typical program. However given a same seed value the program will generate the same random numbers every time the program is run. In order to avoid this repetition across program executions. We have passed the time(NULL) as an argument to the srand() function. Which will initialize the srand with a new value every time the function is called, hence now the numbers generated by rand() would appear to be random.
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int c;
while (1)
{
c = getch(); // first call gets the 0xE0 byte or decimal 224
switch(c) // lets just waste the value
{
case 0:
case 224:
switch (getch()) //Here the actual code for the key is got
{
case 72: cout << "up arrow\n"; break;
case 75: cout << "left arrow\n"; break;
case 77: cout << "right arrow\n"; break;
case 80: cout << "down arrow\n"; break;
default: cout << "extended key " << c << "\n";
}
}
}
return 0;
}
sudo apt-get install apache2
sudo gedit /etc/hosts
127.0.0.1 localhost.localdomain localhost # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
127.0.0.1 localhost.localdomain localhost 127.0.0.1 ccl.local z3d-laptop # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
cd /etc/apache2/sites-available
sudo cp default your-site-name
sudo gedit your-site-name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> |
In this file add the line ServerName test-site-name.local just above the DocumentRoot directive (in front of line 4). Edit DocumentRoot /var/www path on line 4 and set it to /path-to-the-test-site-WITHOUT-trailing-slash. It should look something like this
DocumentRoot /path-to-the-test-site-WITHOUT-trailing-slash
Directory /path-to-the-test-site-WITH-trailing-slash/
AllowOverride None
AllowOverride All
sudo a2ensite test-site-name
sudo /etc/init.d/apache2 restart
apt-get install mysql-server
mysql_secure_installation
mysql -u root -p create database test-db; grant all on test-db.* to 'zed' identified by 'password'; flush privileges; quit
apt-get install php5 php-pear
sudo gedit /etc/php5/apache2/php.ini
max_execution_time = 30 memory_limit = 64M error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR display_errors = Off log_errors = On error_log = /var/log/php.log register_globals = Off
sudo /etc/init.d/apache2 restart
apt-get install php5-mysql apt-get install php5-suhosin
sudo /etc/init.d/apache2 restart
sudo fdisk -l
dd if=/path-to-iso of=/dev/sd?
dd if=/home/me/ubu.iso of=/dev/sdc