Oct 9th, 2012
Internet newsgroup participants have long debated the proper pronunciation of Linux. Because the name Linux was conferred by Linux kernel author Linus Torvalds, his pronunciation of the word should reign as standard as I see it. However, Linus is Finnish and his pronunciation of Linux is difficult for English speakers to approximate. Consequently, many variations in pronunciation have arisen. The most popular pronunciation sounds as though the word were spelled Linnucks, with the stress on the first syllable.
You can hear how Linus Torvalds pronounces Linux:
Edit locale.gen and comment out the locale you need, for example tr_TR.UTF-8 UTF-8
nano /etc/locale.gen
Then run locale-gen
command for activation
locale.gen
dpkg-reconfigure tzdata
mplayer <stream>
mplayer -nocache -afm ffmpeg <stream>
Some internet radios
ffmpeg -i video1.m4v -acodec copy -vcodec copy -f mov video1.mov
ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss START -t LENGTH OUTFILE.mp4
where START is starting positing in seconds or in format hh:mm:ss LENGTH is the chunk length in seconds or in format hh:mm:ss
If let’s say your video is 31 minutes long and you want so split into 15 min chunks here is how you run it:
ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss 0 -t 00:15:00 OUTFILE-1.mp4
ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss 00:15:00 -t 00:15:00 OUTFILE-2.mp4
ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss 00:30:00 -t 00:31:00 OUTFILE-3.mp4
To set home directory
usermod –d /home/user1/
To set root gid and groups for the user1
usermod –g 0 –G 0 user1
To change access rights for a directory
chmod 777 /var/www/directory
To remove package with configuration files
aptitude remove --purge package-name
To remove old configuration files
dpkg --purge package-name
To combine .rar files using unrar
unrar e -kb part01.rar
RarCrack
rarcrack p1r.part1.rar
Creating symbolic link (There is no “/” sign at the end)
ln -s /var/www/existing /var/www/newname
Burning an ISO image to CD-ROM
apt-get install cdrecord
cdrecord -scanbus
... snip ...
1,0,0 100) 'HDT72251' '6DLAT80 ' 'V43O' Disk
1,1,0 101) *
1,2,0 102) *
... snip ...
cdrecord -dev 1,0,0 /tmp/output.iso
Removing kernel
uname –a
dpkg --list 'linux-image*'
sudo aptitude remove linux-image-2.6.18-5-686
Sources List, http://www.debian.org/doc/manuals/apt-howto/ch-basico.en.html
nano /etc/apt/sources.list
Trace a program (ex. pidgin)
strace -v -i -s 9999 $( which pidgin ) >| strace.log 2>&1
To check if a port is free, run the following command:
$ nc localhost 56733 < /dev/null; echo $?
If the output of the command above is 1, then the port is free and usable.
Delete ‘Where From’ metadata from files
xattr /Path/To/File
You’ll get a key named com.apple.metadata:kMDItemWhereFroms. To delete this key in the Terminal, run:
xattr -d com.apple.metadata:kMDItemWhereFroms /Path/To/File
Install ntfs-3g library
aptitude install ntfs-3g
Shows all the disk drives
fdisk -l
To make writable mount
mount /dev/sda1 /mnt/sda1 -t ntfs-3g -o rw,umask=0022,uid=dev,gid=dev
umask is a filter of permissions, so it works in the opposite way to chmod. Full permissions are equivalent to 777 (rwxrwxrwx). A umask of 0222 (-w–w–w-) leaves 555 (r-xr-xr-x).
mount /dev/sda1 /mnt/sda1 -t ntfs -r -o umask=0222,uid=dev,gid=dev
-rwxr-x— 1 dev dev 28096 Aug 24 1996 chkdsk.exe
umount /mnt/sda1/
To make writable mount
mount /dev/sda1 /mnt/sda1 -t ntfs-3g -o rw,umask=0022,uid=dev,gid=dev
Under UNIX and Linux like oses a loop device (a pseudo-device) can make a file accessible as a block device. It is is often used for CD / DVD ISO images and floppy disc images. Mounting a file containing a filesystem via such a loop mount makes the files within that filesystem accessible. They appear in the mount point directory.
Open terminal and create a mount point:
sudo mkdir /home/user/iso
If your iso image is at /tmp/file.iso, type the following to mount it:
sudo mount -o loop /tmp/file.iso /home/user/iso
To unmount type the command:
sudo umount /home/user/iso
shtool platform -v -F "%sc (%ac) %st (%at) %sp (%ap)"
cat /etc/*-release
Install netkit-ping, traceroute, dnsutils, ipchains (for 2.2 kernel), iptables (for 2.4 kernel), and net-tools packages and:
ping google.com # check Internet connection
traceroute google.com # trace IP packets
ifconfig # check host config
route -n # check routing config
dig [@dns-server.com] host.dom [{a|mx|any}] |less # check host.dom DNS records by dns-server.com for a {a|mx|any} record
ipchains -L -n |less # check packet filter (2.2 kernel)
iptables -L -n |less # check packet filter (2.4 kernel)
netstat -a # find all open ports
netstat -l --inet # find listening ports
netstat -ln --tcp # find listening TCP ports (numeric)
To create partition on hard drive B
cfdisk /dev/sdb
Choose New, Primary and then Write and Quit
To format 1st partition on hard drive B
mkfs /dev/sdb1
Use convert
program (it is an executable installed as part of Imagemagick
suite of tools):
convert 'p%d.jpg[1-148]' file.pdf
convert "*.{ext1,ext2,ext3,...}" -quality 100 outfile.pdf
Install netpbm and GIMP
aptitude install netpbm gimp
Step # 1: Convert logo to ppm raw format
Step # 2: Convert portable pixmaps into a Windows .ico file
ppmtowinicon -output favicon.ico favicon.ppm
Install imagemagick first
brew install imagemagick
and use convert tool
convert -background transparent icon.png -define icon:auto-resize=16,32,48,64,256 icon.ico
To cycle through alternatives by repeatedly hitting Ctrl+R
E.g.:
Ctrl+R grep Ctrl+R Ctrl+R ...
mogrify -format jpg -background white -flatten *.png
Using the xattr command, you can inspect the extended attributes:
$ xattr s.7z
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine
and use the -d option to delete one extended attribute:
$ xattr -d com.apple.quarantine s.7z
$ xattr s.7z
com.apple.metadata:kMDItemWhereFroms
you can also use the -c option to remove all extended attributes:
$ xattr -c s.7z
$ xattr s.7z
You can compare the SHA-256 checksum of your downloaded binary against the checksums that are provided for every release. To generate a SHA-256 checksum of your downloaded binary, then open the corresponding checksum file and ensure that it contains the same number.
$ shasum -a 256 downloaded_binary.tar.gz
For downloading files from a directory listing, use -r
(recursive), -np
(don’t follow links to parent directories), and -k
to make links in downloaded HTML or CSS point to local files
wget -r -np -k [web_address]
Other useful options:
from Mac
hdiutil
:hdiutil convert -format UDRW -o /path/to/target.img /path/to/source.iso
Note: OS X tends to put the .dmg ending on the output file automatically. Rename the file by typing:
mv /path/to/target.img.dmg /path/to/target.img
diskutil list
to get the current list of devicesdiskutil list
again and determine the device node assigned to your flash media (e.g. /dev/disk2)Run diskutil unmountDisk /dev/diskN
(replace N with the disk number from the last command - in the previous example, N would be 2)
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
(replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).Note: Using /dev/rdisk instead of /dev/disk may be faster.
Note: If you see the error dd: Invalid number ‘1m’, you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
Note: If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the ‘Disk Utility.app’ and unmount (don’t eject) the drive.
diskutil eject /dev/diskN
and remove your flash media when the command completesNow the USB stick is ready. Boot the device that you want from the USB stick.
sha3sum somefile.txt > somefile.txt.sha3
cat somefile.txt.sha3
765597429418c1b6e4a0d1ad52f2e3feb39c09e0709290571afad07f somefile.txt