Search This Blog

Showing posts with label magic. Show all posts
Showing posts with label magic. Show all posts

Friday, October 25, 2013

Snake's magic

Simple example:

!#/usr/bin/env python

x = 'abcdef'

if x.find('z'):
    print 'True'
else:
    print 'False'

What result will you get after run this python code ? False ?, are you sure  ?

Thursday, June 7, 2012

bash multiline write to file


cat > ./outfile << DELIM
hello proble
h2 fadernaly
DELIM

Sunday, April 8, 2012

How to disable CTRL+ALT+Del keys

Open /etc/inittab file, enter:
# vi /etc/inittab

Search for line that read as follows:
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

And remove the line or comment out the above line by putting a hash mark (#) in front of it:
# ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

Save the file and exit to shell promot. Reboot system to take effect or type command:
# init q

source