Notes by woolf
Displaying keyword search results 1 - 11
Created by woolf on December 29, 2011 11:18:11
Last update: December 29, 2011 11:18:11
Use the expand command to extract files from a .cab file:
expand [-r] source [destination] [-d source.cab ... Option Description [-r] Renames expanded files. [destination] Specifies where files are to be expanded. If source is multiple files and -r is not specified, destination must be a directory. destination can consist of a drive letter and colon, a directory name, a file name, or a combination of any of these. [-d source.cab] Displays a list of files in the source location. Does not expand or extract the files. [-f:files] Specifies the files in a cabinet (.cab) file that you intend to expand. You can use wildcards (* and ?). source.cab Specifies the files to expand. source can consist of a drive letter and colon, a directory...
Created by woolf on July 19, 2011 09:06:49
Last update: September 30, 2011 11:52:19
Nmap port scan against host 10.2.1.3 , with TCP SYN scan ( -sS ), OS detection ( -O , capital O, not zero) and verbose output ( -v ):
nmap -v -sS -O 10.2.1.3
If ping is blocked, add switch -PN :
nmap -v -sS -O -PN 10.2.1.3
Shortcut option -A for version detection, Nmap Scripting Engine with the default set of scripts, remote OS detection, and traceroute (equivalent to: -sV -sC -O --traceroute ):
nmap -A 10.2.1.3
Created by woolf on September 21, 2011 16:23:06
Last update: September 21, 2011 16:24:29
VirtualBox creates/uses a network adapter named vboxnet0 on the host, when a VM network adapter is connected as "host-only". As the VM starts, VirtualBox assigns the IP address 192.168.56.1 to vboxnet0 on the host. The VM DHCP client grabs the IP address 192.168.56.101 from the VirtualBox DHCP server. Connectivity is limited between the VM and the host - unless you configure NAT and IP forwarding on the host.
For OpenWRT, if the DHCP client is not started automatically:
#/sbin/udhcpc -i br-lan -p /var/run/udhcpc.pid -s ...
Created by woolf on July 27, 2011 20:56:11
Last update: July 27, 2011 20:56:11
Install the DHCP server:
voodoo@newpc:~$ sudo apt-get install dhcp3-server
...
Edit /etc/dhcp/dhcpd.conf (this is the minimum for a local network without DNS):
ddns-update-style none;
default-lease-time ...
Start the DHCP server:
voodoo@newpc:/etc/dhcp$ sudo /etc/init.d/isc-dhcp-...
Created by woolf on July 05, 2011 16:03:48
Last update: July 05, 2011 16:03:48
The DHCP client packaged with BusyBox is udhcpc . It negotiates a lease with the DHCP server and executes a script when it is obtained or lost. There are four possible arguments to this script: deconfig : The script should put the interface in an up but deconfigured state. bound : The script should configure the interface and set any other relevant parameters. renew : This is used when a lease is renewed. IP address does not change but other parameters may change. nak : This happens when a NAK packet is received from the DHCP server. Network parameters are passed to the script via environment variables. Ubuntu documents that the default script is at /etc/udhcpc/default.script . For OpenWRT, it is located at /usr/share/udhcpc/default.script ....
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 04, 2011 10:16:11
Last update: July 04, 2011 12:09:44
The following procedure will clear out the NVRAM and set dd-wrt back to default values:
With the unit powered on, press and hold the reset button on back of unit for 30 seconds
Without releasing the reset button, unplug the unit and hold reset for another 30 seconds
Plug the unit back in still holding the reset button a final 30 seconds
This procedure should be done before and after every firmware upgrade/downgrade.
The firmware writes information to the Nvram . A hard reset clears that information. If you don't clear it properly, parts of the old information be present with the new firmware, which can make it not operate properly.
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: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
Created by woolf on February 10, 2011 13:25:20
Last update: February 10, 2011 13:25:20
If Command Extensions are enabled (which is enabled by default), then there are several dynamic environment variables that can be expanded but which don't show up in the list of variables displayed by SET . These variable values are computed dynamically each time the value of the variable is expanded (but see example below). If the user explicitly defines a variable with one of these names, then that definition will override the dynamic one described below: %CD% - expands to the current directory string. %DATE% - expands to current date using same format as DATE command. %TIME% - expands to current time using same format as TIME command. %RANDOM% - expands to a random decimal number between 0 and 32767. %ERRORLEVEL% - expands to the...
Created by woolf on May 05, 2009 04:05:08
Last update: January 15, 2010 02:50:49
Remove the sound track. The default output format is avi, even though the input file is mpeg.
mencoder -ovc copy -nosound PandaKing.mpg -o PK-no...
Add a sound track:
mencoder -ovc copy -audiofile PandaKing.ac3 -oac c...
Replace the sound track and encode to mpeg:
mencoder -ovc copy -audiofile PandaKing.zh.ac3 -oa...
Looks like mencoder does not support multiple audio tracks . Check avimux from transcode project, or avidemux2.