Tonight I’m being plagued by dropped ssh connections. 2 minutes of work, them bam everything goes away. I’ve seen screen used in the past, but never had to use its power until tonight. Ask any seasoned sysadmin and they’ll tell you that screen has saved their bacon many times, and it did for me tonight.…
Using screen in Linux to save your bacon
Comment on Using screen in Linux to save your bacon
SYSSTAT: SAR/IOSTAT
The pidstat command is used to monitor processes and threads currently being managed by the Linux kernel. It can also monitor the children of those processes and threads.
With its -d option, pidstat can report I/O statistics, providing that you have a recent Linux kernel (2.6.20+) with the option CONFIG_TASK_IO_ACCOUNTING compiled in. So imagine that your…
Comment on SYSSTAT: SAR/IOSTAT
Quick SCP
Logged into source host
scp -r -p * root@remotehost:/home/user/public_html
This will copy *all* files to the directory /home/user/public_html in the remote server remotehost. The -p preserves the modification and access times, as well as the permissions of the source-file in the destination-file. The -r copies the contents of the source-file (directory in this case) recursively.
SCP / SSH recipes
scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]
Description of options
from-host
Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command
user
Is the user which have the right to access the file and directory that is supposed to be…
Find to copy files into single directory
Makes copy of subset of dir/ and below with files that match the criteria. It keeps the nested directory structure. Uses
-print0 | xargs -0
to handle spaces in Windows names
find /cygdrive/f/dir1/ -name ‘*.doc’ -print0 | xargs -0 cp -a –target-directory=/cygdrive/c/Temp –parents
Comment on Find to copy files into single directory
Updated find to list script
This is an update to the earlier script.
#!/bin/sh
# v1 jcz 30-dec-2009
# This is a silly little script that will search
# for files of a certain type and create a text file of the results
# TODO:
# – Everything
# – Fix this script to run under cygwin 1.7.X after working fine under 1.5.X
############################
# enable for debugging #####
############################
#…
Comment on Updated find to list script
Search lister
This little script needs a lot of help But it will recurse down through the current directory and create a listing of files, their folders, sizes, and modification dates and times. it was written to run on Windows under Cygwin.
#!/bin/sh
# v1 jcz 30-dec-2009
# This script will search for files of a certain type and create…
Linux/UNIX/Cygwin find command
This is another one of those notes to myself because I look this stuff up every six months.
Basics of find. The following is a complete rip off of the content at: http://content.hccfl.edu/pollock/unix/findcmd.htm
But I wanted to keep a copy safe here. Thanks Wayne Pollock on 12/30/2009 10:27:30.
FIND
The -print action lists the names of files separated by…
Comment on Linux/UNIX/Cygwin find command
How to set a static IP in Ubuntu from the shell
Edit
/etc/network/interfaces
and adjust it to your needs (in this example setup I will use the IP address 192.168.0.100):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will…
Comment on How to set a static IP in Ubuntu from the shell
Remastersys Notes
My latest project is to turn my favorite Linux desktop configurations into stand alone distributions that I can run as LiveCDs or install anywhere.
Here are some links so that I don’t forget.
http://www.ubuntugeek.com/creating-custom-ubuntu-live-cd-with-remastersys.html