Notes by woolf

Displaying keyword search results 1 - 10
Created by woolf on September 30, 2011 13:58:02    Last update: September 30, 2011 13:58:14
Use IO redirection to swap stdout and stderr : $ prog 3>&1 >&2 2>&3 3>&-
Created by woolf on September 08, 2011 11:19:52    Last update: September 08, 2011 11:19:52
To check a command exists on PATH: Use the return code of which : which some_command &>/dev/null [ $? -eq 0 ] || ... For bash, use type -P : type -P some_command &>/dev/null && echo "ome_comm... or check_path() { if ! type -P $1 &> /dev/...
Created by woolf on July 29, 2011 08:34:34    Last update: July 29, 2011 08:34:34
This errors out, but will remove an assigned IP address anyway: $ sudo ifconfig eth0 0.0.0.0 netmask 0.0.0.0 if...
Created by woolf on July 05, 2011 15:38:52    Last update: July 05, 2011 15:39:55
By default VirtualBox enables one network adapter ("Adapter 1") with NAT. Connection from the guest OS to the outside world works natually when the guest network adapter is assigned an IP address by the VirtualBox DHCP server. Use VBoxManage to see a list of DHCP servers: $ VBoxManage list dhcpservers NetworkName: H... The guest IP address is not visible from the outside world. If you need to access a server on the guest OS, you need to set up port forwarding in VirtualBox settings: Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding . Beware that on Linux/Unix, port forwarding may not work if you bind to a privileged port (port number < 1024) but you are not root. Bridged networking can be...
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 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 woolf on May 20, 2011 14:00:35    Last update: May 20, 2011 14:01:36
To remove new line characters from a file: with tr : tr -d '\n' < the-file.txt or cat the-file.txt | tr -d '\n' with sed : sed ':a;N;$!ba;s/\n//g' the-file.txt or cat the-file.txt | sed ':a;N;$!ba;s/\n//g' The sed version is a bunch of commands to manipulate the register etc. Regex replace " s/\n//g " does not work because sed regex works on a single line. More tips from this Linux blog: http://linux.dsplabs.com.au/rmnl-remove-new-line-characters-tr-awk-perl-sed-c-cpp-bash-python-xargs-ghc-ghci-haskell-sam-ssam-p65/
Created by woolf on May 15, 2011 15:11:42    Last update: May 15, 2011 15:11:57
On windows, display IPv4 routing table: route -4 print On Linux: $ route Kernel IP routing table Destination ... This works for both Linux and Windows (" -r ": display routing table, " -n ": display address and port numbers in numerical form): netstat -rn
Created by woolf on May 15, 2011 14:56:42    Last update: May 15, 2011 14:57:34
tracert / traceroute reports the hops from the source to the destination host. On Windows: tracert www.google.com Tracing route to www... Linux example: # wait 5 seconds # 3 queries each hop # maxi...
Created by woolf on May 15, 2011 14:35:58    Last update: May 15, 2011 14:36:47
Assign IP adrress and network mask: sudo ifconfig eth0 192.168.183.5 netmask 255.255.2... Add default gateway: sudo route add default gw 192.168.183.2 Add name server: " sudo vi /etc/resolv.conf " and add: nameserver 192.168.183.2
Previous  1 2 Next