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.
mcrypttool to easily encrypt files whether the file is large or small in size. We will also use Mcrypt to encrypt and compress files and directories on the fly which can be usefully for a number of backup and scripting purposes.
UBUNTU/DEBIAN # apt-get install mcrypt REDHAT/FEDORA/CENTOS # yum install mcrypt
$ mkdir dir1 $ cd dir1/ $ echo "My File to Encrypt" > file1 $ cat file1 My File to Encrypt $ fallocate -l 500MB file2 $ md5sum file* bccd44aaa84c7c9d04a268f670ae92c5 file1 4034379ecc54213fc9a51785a9d0e8e2 file2Read more...
/var/lib/puppet/reports/each time it is executed. If the puppet executions are rather frequent, depending on the filesystem size this may create a little bit of problem with disk space as this small in file size reports consume disk space and more importantly each of the files created take on inode. Thus, before you know it you run into a trouble of missing free inodes. Puppet YAML reports eg:
# ls /var/lib/puppet/reports/webserver.localdomain 201501142321.yaml 201501142322.yamlRead more...
#!/usr/bin/env python while True: try: # Try to convert bunary to decimal decimal_num = int(raw_input("Enter a binary number: "), 2) # If we fail we ask again user to enter binary number except ValueError: print "Your input is not a binary number! Please try again." else: # Exit program if the conversion from binary to decimal was successful break # print converted decimal number print decimal_numSave your script as eg. binary2decimal.py, make it executable and execute:
$ chmod +x binary2decimal.py $ ./binary2decimal.pyRead more...
SElinuxand the system is now using
init. Nevertheless, those who have already did reset root password on the Linux system will be with the following steps familiar. Here is the procedure of what needs to be done in order to recover a forgotten root password on Redhat 7 Linux:
/partition to allow read and write
# yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-20.noarch.rpm # yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-20.noarch.rpmThe above packages are for Fedora 21 Linux so check RPMFusion website to update the above links so they math your Fedora Linux system. Once you have run the above commands you need to update repository index:
# yum updateRead more...
grepthus to avoid any need to for additional software installation. Let's start by testing our
eth0network interface for a physical cable connection in a low-level and Linux distro-agnostic way:
# cat /sys/class/net/eth0/carrier 1The number
1in the above output means that the network cable is connection physically to your's network card slot. Next, we will test second network interface
~# cat /sys/class/net/eth1/carrier cat: /sys/class/net/eth1/carrier: Invalid argumentRead more...
# yum install git wgetNext, we need to install
# wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz --no-check-certificate # tar xzf setuptools-7.0.tar.gz # cd setuptools-7.0 # python setup.py install
# apt-get install git python-setuptools pythonRead more...