This intends to be a list of easy to find useful commands for working with docker. If you are looking for information about docker go to Docker docs homepage
I want to remove the 1st and the 5th columns of a text file of tab separated values. The file is as follows:
HEAD1 HEAD2 HEAD3 HEAD4 HEAD5 HEAD6 1.0 -3 3.4 2 7 9 -100 -30 -1 0 -80 7 70 7 8 0 3 0 71 4.5 2.1 0.6 37 4
I want to share my Interent connection from my linux to another equipment.
First you have to enable NAT in your linux,
as root you must type:
# iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
Then, logged as root, you have to enable IP forwarding.
There are two ways:
# sysctl -w net.ipv4.ip_forward=1
# echo 1 > /proc/sys/net/ipv4/ip_forward
Now you have to configure in your other device the IP of your linux as default gateway.
And that’s all folks!
If you have problems with iptables and you want to remove all the rules write:
iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
To record what appears on the screen or in an application you can use the program recordmydesktop
To record the whole screen use:
$ recordmydesktop -o screencast.ogv
By default it uses a low frame rate and recods audio, If you want to use a higher frame rate without audio:
$ recordmydesktop --no-soundo --fps 24 -o screencast.ogv
Probably you want to record a window application, not the whole screen. To do that you fist need to know the Window id which can be obtained with the xwininfo command:
$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x1a00003 "5554:intel17" Absolute upper-left X: 1467 Absolute upper-left Y: 122 Relative upper-left X: 1 Relative upper-left Y: 32 Width: 712 Height: 800 Depth: 24 Visual: 0x22 Visual Class: TrueColor Border width: 0 Class: InputOutput Colormap: 0x1a00010 (not installed) Bit Gravity State: ForgetGravity Window Gravity State: NorthWestGravity Backing Store State: NotUseful Save Under State: no Map State: IsViewable Override Redirect State: no Corners: +1467+122 -781+122 -781-128 +1467-128 -geometry 712x800+1466+90
In this case we are trying to record from the Android emulator. I know that for this purpose, if your android emulator version is 4.4 or higher, you can use the following commands over command-line:
$ adb shell screenrecord /sdcard/demo.mp4 $ adb pull /sdcard/demo.mp4
But in this case we are going to record from the host PC. So, if you want to record some part of the window, in our example the window has 480px and the remainder are just window decorators, write the following:
recordmydesktop --no-sound --windowid 0x1a00003 --fps 24 --width 480 -o screencast.ogv