OS: Ubuntu 14.04 LTS RAM: 8 GB CPU: 4 X Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz KERNEL: Linux ubuntu 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux SATA: IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family 4 port SATA IDE Controller BENCHMARK UTILITY: gnome-disksRead more...
sfdiskcommands you will get a following warning:
Disk /dev/sda: 256.1 GB, 256060514304 bytes 255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sda doesn't contain a valid partition table WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.Read more...
Falseif the number supplied is less than 2 and if the number is equally divisible with some other number different than 1 and itself. If none of the previous conditions apply the function will return
True. The below python script will let user to decide how many numbers needs to be check to see whether the number is prime number:
#!/usr/bin/env python prime_numbers = 0 def is_prime_number(x): if x >= 2: for y in range(2,x): if not ( x % y ): return False else: return False return True for i in range(int(raw_input("How many numbers you wish to check: "))): if is_prime_number(i): prime_numbers += 1 print i print "We found " + str(prime_numbers) + " prime numbers."Read more...
~/.vnc/passwdis the default location where the VNC password is stored. The password is stored at this location when the
vncserverstarts for a first time. To update or change your VNC password you should use
vncpasswdwill promt you two times to enter your new password:
$ vncpasswd Password: Verify:The
vncpasswdcommand also accepts a password input from STDIN which also allows to store password file into different location. The following example will change the VNC password to
MYVNCPASSWORDand store it to
~/.secret/vncpassgiven that the
$ echo MYVNCPASSWORD | vncpasswd -f > ~/.secret/passvnc $Read more...
pastecommand. Consider a following example. In our sand box directory we have 3 files where each contains a single column of date:
$ ls f1 f2 f3 $ cat f1 az dr qw rt er $ cat f2 iu dr gg hh jj qq ee ui $ cat f3 qp dfNext, we can join them together using
$ paste f1 f2 f3 az iu qp dr dr df qw gg rt hh er jj qq ee uiRead more...
TABseparated use a following command to convert it to comma separated value file before you proceed.
$ cat test 1 2 4 4 2 3 3 3 $ sed 's/\t/,/g' test 1,2,4,4 2,3,3,3 OR $ cat test | tr '\t' ',' 1,2,4,4 2,3,3,3Read more...
sedcommand and bash shell. Here is a content of our sample file:
$ cat example.txt AAAAAAAAAA BBBBBBBBBB CCCCCCCCCC DDDDDDDDDD EEEEEEEEEENext, we are going to remove a second row from the above
$ sed 2d example.txt AAAAAAAAAA CCCCCCCCCC DDDDDDDDDD EEEEEEEEEERead more...
# apt-get install cmake libsdl-image1.2-dev libboost1.55-all-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libpango1.0-dev libsdl-net1.2-dev wgetOnce the prerequisites are installed download Wesnoth's source code. For this we use wget:
$ wget -c http://downloads.sourceforge.net/project/wesnoth/wesnoth-1.12/wesnoth-1.12/wesnoth-1.12.tar.bz2Read more...
/etc/hostsfile. This is not a bulletproof solution but should help as a first level privacy protection for your kids, your self or should aid if your students do not pay enough attention in the class.