Category: HowTo


Linux Malicious Commands to Know!

These commands will erase your hard drive:


sudo mkfs
sudo mkfs.ext3
sudo mkfs.bfs
sudo mkfs.cramfs
sudo mkfs.ext2
sudo mkfs.minix
sudo mkfs.msdos
sudo mkfs.reiserfs
sudo mkfs.vfat

These will damage your operating system.


sudo rm -rf / (deletes all your files on your system)
sudo rm -rf * (deletes all your files on your system)
rm -rf * or rm -rf *.* (deletes all your files on your system)
rm -rf ~/ & (deletes all your files on your system)

 

luckily for the most part you don’t have to worry about people doing these command because of ‘sudo’ unless they know your password :/

well now you know, use this power for good!

How to: Install .bin file

How to: Install .bin file

You can install it from CUI. Just open a terminal and type this:

Code:
chmod +x file.bin
./file.bin

The installation will then start.

The simplest way to extract to a specific directory:
For a .tar.gz:

Code:
tar -xvzf file.tar.gz -C directory

For a .tar.bz2:

Code:
tar -xvjf file.tar.bz2 -C directory

To extract a tar.bz2 file, use the command (note the j option)

Code:
tar -jxvf filename.tar.bz2

To extract a tar.gz file, the the command (note the z option)

Code:
tar -zxvf filename.tar.gz

More then one distro on USB? Sign me up!

Tutorial on how to boot more then one Linux Distro from your USB:

http://pcplus.techradar.com/feature/linux/multi-boot-linux-usb-30-12-10

I haven’t had a chance to run through this, but this is an amazing idea. Its perfect, i know once i get some free time i am going to put Ubuntu, Mint and slax all on my 8gig!

Enjoy~

If you ever tried to add korean in your prints or what have you with python you will notice you get an error looking like this:

SyntaxError: Non-ASCII character ‘\xec’ in file gravity.py on line 10, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Luckily this is an extremely easy fix!

just add this to the top of your script:

# -*- coding: utf-8 -*-

example source with korean:

http://pastebin.com/eXWsxZM9

Enjoy and Happy New Years!

Android

Android

Before we start i just want everyone to know PC = windows. PC means personal computer, not an operating system.

Now you might be asking why would you want to run Android on your PC? Well why not, its an easy way to test our the OS as well as test applications on it.

The androids home is http://code.google.com/p/live-android.

USB booting

The easiest way i find to running Android on your PC is through USB. You will need the right ISO, you can find that here.

1. Choose the files ‘liveandroidv0.2usb.iso.001’ and ‘liveandroidv0.2usb.iso.002’ to download, when you have both right click and extract ‘liveandroidv0.2usb.iso.001’ this will join both files into one.

2. Download UNetbootin. This will convert the ISO into a readable and bootable USB operating system.

3. Run UNetbootin, load the Liveandroid.iso into the unetbootin application. Ensure your USB is inserted, select the right drive of your USB. Then allow UNetBootin to turn your USB into a portable OS.

4. After the install is completed restart your computer, turn on USB mode in your bios and then boot from USB. If your turned USB mode on you will see an option to boot from USB.

Note: If your computer hangs on boot up that means your hardware is not compatible with running Android. Try it on another PC or try loading the ISO in a virtual machine.

looking for some good Gimp Tutorials i was lucky enough to find this large amount of tutorials. So i figured why not sure them out:

http://www.scottphotographics.com/40-best-gimp-tutorials-of-2010/

Here are my top  favorite tutorials off of that list:

Glow FX extreme

Glow FX ExtremeGlow FX Extreme

The creepy zombie hand of death

The creepy zombie hand of death!The creepy zombie hand of death!

How to apply a logo to an object

How to apply a logo to a textured imageHow to apply a logo to a textured image

Sun Burst Effect through clouds

Sun Burst Effect through CloudsSun Burst Effect through Clouds

Metal wires and abstract background

Metal wires and abstract background in GIMPMetal wires and abstract background

How to make a photo grungy

how-to-make-photos-grungy-in-gimp-3.jpgThe finished JPEG

ake Photographs Vintage

Vintage Photograph in GIMPVintage Photograph in GIMP

 

 

 

 

 

 

How To Write Unmaintainable Code

Heres a little interesting Java article i found thought i would share with my java readers:

http://freeworld.thc.org/root/phun/unmaintain.html

 

Heres some quotes:

In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes. Further, if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn’t be able to maintain the code!

VIM!The Amazing thing about being in the world of 2010 is we have so many more advance technologies. When it comes to linux terminal, there are so many wonders that can be done. But how come the default terminal colors are 8?

Go ahead type:

tput colors
 see that number 8? ridiculous right? 

As of now there is a posibility of 256 colors  usable for the terminal. 
Luckily this is easy to make happen!
First install:

sudo apt-get install ncurses-term

and stick the following in your ~/.bashrc and/or ~/.bash_profile:

export TERM=xterm-256color

After you edit your .bashrc or .bash_profile source that same file:

source ~/.bashrc

Now retype that command above

tput colors

 


that is more like it! 😀

Now what is this good for?
Vim themes, terminal browsers, and anything else that might use color.
Speaking of vim themes! My top vim themes coming soon!

To hold you over heres an awesome them called xoria256.vim (which will only work with 256 terminal colors)
http://www.vim.org/scripts/script.php?script_id=2140

Intro to TCPDump [Part 1]

TCPDump

tcpdump – dump traffic on a network

Synopsis:

tcpdump [-adeflnNOpqRStuvxX][-c count]

[-C file_size][-F file]

[-i interface][-m module][-r file]

[-s snaplen][-T type][-U user][-w file]

[-E algo:secret][expression]

Description:

Tcpdump prints the headers of packets on a network interface that matches the boolean expression.

-w flag, save the packet data to a file

-r flay, read from a saved packet file rather then read packets from a network interface

Tcpdump will continue capturing packets until it is interrupted (ctrl-c or kill command)

If it is started with -c flay, it will capture packets until it is interrupted by a SIGINT or SIGTERM signal or until specified number of packets are processed

When tcpdup is done capturing packets, it will report counts of:

-packets “received by filters”

-packets “dropped by kernel”

Note: You must be root but reading a saved packet file doesn’t require privileges

 

Options:

-a

Convert network and broadcast addresses to names

-c

exit after receiving count packets

-C

Before writing a raw packet to a savefile, check to see if file is larger than file_size and if it is, close the current savefile and open a new one.

-d

dump the comiled packet-matching code in a human readable from to standard output and stop

-e

print the link-level header on each dump line

-f

print ‘foreign internet addresses numerically instead of symbolically

-F

use file as input for the filter expression

-i

listen on interface

-I

useful if you want to see the data while capturing it

-m

load smi mib module definitions from file module

-n

don’t convert host addresses to names (got to avoid dns lookups)

-nn

don’t convert protocol and port numbers to names

-N

don’t print domain name qualifications of hosts

-q

less print protocol info so output is shorter

-r

read packets from file (that has been created with -w)

-S

print absolute rather then relative TCP sequence numbers

-T

force packets selected by expression to be interpreted the specified type

Currently known types:

-cnfp (cisco netflow protocol)

-rpc (remote procedure call

-rtp (real-time applications protocol)

-rtcp (real time application control protocol)

-snmp (simple network management protocol)

-vat (visual audio tool)

-wb (distributed white board)

-t

dont print a timestamp on each dump line

-tt

print an unformatted time stamp on each line

-u

print undecoded NFS handles

-w

write the raw packets to file rather then parsing and printing them out. they can later be printed with the -r option

-x

print each packet in hex

-X

when printing hex, print ascii too

Expressions:

type

qualifiers say what kind of thing the id name or number refers to.

possible types are:

-host (host foo)

-net (net 128.3)

-port (port 20)

if no type qualifier host is assumed

dir

qualifiers specify a particular transfer direction to and/or from id

possible directions are:

-src (src foo)

-dst (dst net 128.3)

-src or dst (src or dst port ftp-data)

– src and dst (src and dst port ftp-data)

‘src or dst’ is assumed

proto

qualifiers restrict the match to a particular protocol

possible protos are:

-ether

-fddi

-tr

-ip

-ip6

-arp

-rarp

-decnet

-tcp

-udp

 

Allowed primitives are:

 

dst host host

true if the IPv4/v6 destination field of the packet is host, which maybe the address or name

src host host

true if the ipv4/v6 source field of the packet is host

host host

true if the ipv4/v6 soure or destination of the packet is host

any of the above host expressions can be prepended with the keyboards

example:

ip host host

which is the same as:

ether proto \ip and host host

 

 

%d bloggers like this: