Recent Notes
Displaying keyword search results 51 - 60
Created by woolf on July 03, 2011 19:29:45
Last update: July 05, 2011 08:28:06
eHow gave this command for defragging NTFS in Linux:
fsck -t ntfs --kerneldefrag /dev/XXX
which was rebuked by stack exchange . I believe the latter is right: there's no such thing!
Yes, there's a set of utilities called ntfsprogs (including ntfsresize, which is widely used), but defragmentation does not seem to be part of it.
Created by magnum on June 25, 2011 09:56:01
Last update: June 25, 2011 09:56:01
$ sudo apt-get install libssl-dev
Created by magnum on June 23, 2011 20:15:49
Last update: June 23, 2011 20:29:45
Linux services startup order in general: kernel runs /sbin/init /sbin/init reads /etc/inittab and runs script defined by this line:
si::sysinit:/etc/init.d/rcS switches to runlevel defined by id:3:initdefault: which causes /etc/init.d/rc to be called with the current run level. /etc/init.d/rc calls the scripts under the /etc/rc <current_run_level> .d directory (symbolic links to actual scripts under /etc/init.d/ ) in this order: The KILL scripts first (scripts with name starting with K, i.e., rc?.d/Knn name ): "script_name stop" then, the START scripts (scripts with name starting with S, i.e., rc?.d/Snn name ): "script_name start" Within each group (KILL or START), run scripts from lower priority number (i.e., the nn in the symlink name) to higher priority number. The Upstart init daemon does not use /etc/inittab . Instead, it...
Created by magnum on June 23, 2011 13:44:21
Last update: June 23, 2011 13:59:26
Fedora/Redhat List current status (for httpd):
# chkconfig --list httpd Warning: this works only when one of /etc/rc runlevel .d/ K NN name or /etc/rc runlevel .d/ S NN name exists. It exports wrong status when both K and S scripts exist (in which case the status should be enabled). Enable sshd for run levels 2, 3, 5: # chkconfig --level 2,3,5 sshd on Disable sshd for run levels 2, 3, 5: # chkconfig --level 2,3,5 sshd off By default, the on and off options affect only runlevels 2, 3, 4, and 5. Debian/Ubuntu Add apache2 with defaults : # update-rc.d apache2 defaults If defaults is used then update-rc.d will make links to start the service in runlevels 2, 3, 4, 5 and to stop...
Created by magnum on June 23, 2011 13:08:47
Last update: June 23, 2011 13:08:47
In Linux shell (bash & ksh), executing " set -m " turns on job control . This option is on by default for interactive shells . Background processes run in a separate process group and a line containing their exit status is printed upon their completion.
Created by magnum on June 23, 2011 13:01:49
Last update: June 23, 2011 13:01:49
Job control refers to the ability to selectively stop (suspend) the execution of processes and continue (resume) their execution at a later point. A user typically employs this facility via an interactive interface supplied jointly by the operating system kernel's terminal driver and bash. If the operating system on which bash is running supports job control, bash contains facilities to use it. Typing the suspend character (typically ^Z , Control-Z) while a process is running causes that process to be stopped and returns control to bash. A ^Z takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded. Typing the delayed suspend character (typically ^Y , Control-Y) causes the process to be stopped when it attempts to...
Created by magnum on June 23, 2011 11:44:00
Last update: June 23, 2011 11:44:00
To remove an IP address:
# ip address del 192.168.99.37/24 brd + dev eth0
To add an IP address to device eth0 with a label eth0:0 :
# ip address add 192.168.99.37/24 brd + dev eth0 l...
Created by voodoo on June 21, 2011 08:19:33
Last update: June 21, 2011 08:34:28
Got "base64: invalid input" error:
$ base64 -d base64_encoded.txt >original.bin
ba...
which can be easily dismissed as "input is invalid base64 encoded" or "partial input". But I know it's valid base64 encoded input!
The problem was, the input was base64 encoded on Windows! The error goes away after converting to Unix format with dos2unix .
dos2unix < base64_encoded.txt | base64 -d >origina...
Version of base64 used:
$ base64 --version
base64 (GNU coreutils) 8.5
...
Created by woolf on June 18, 2011 21:21:56
Last update: June 18, 2011 21:34:56
I haven't test these. They are collected for reference only. With mencoder, from HOWTO: Convert and write AVCHD (.mts) to DVD with Linux
mencoder -oac copy -ovc lavc -of mpeg -mpegopts fo... With HandBrake (GUI): Transcoding AVHD (Cannon HF100 .mts) into a usable open format (MKV w/ FFMPEG) With ffmpeg & WinFF (GUI and command line): How to convert Canon .mts video files to other formats in Ubuntu With mencoder, from Transcoding AVCHD (.mts or .m2ts) files using mencoder on Linux (no deinterlacing): # 1 pass mencoder $file -o ./$file.avi -oac cop... With ffmpeg, from Stuttering playback of canon MTS files #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... With mencoder, from [MEncoder-users] problems with AVCHD (.mts) + Deinterlace...
Created by voodoo on June 16, 2011 11:34:39
Last update: June 16, 2011 11:34:59
Some ways to refresh DHCP on Linux:
To release IP address lease:
$ sudo dhclient -r
then, to get fresh IP:
$ sudo dhclient
Use ifdown and ifup :
$ sudo ifdown eth0
$ sudo ifup eth0
Restart network:
$ sudo /etc/init.d/network restart
or,
$ sudo /etc/init.d/networking restart