You are currently browsing the Linux category

Using screen in Linux to save your bacon

February 28, 2010 - 11:08 pm

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 - continue reading

Comment on Using screen in Linux to save your bacon

SCP / SSH recipes

February 3, 2010 - 8:15 am

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…

SCP / SSH recipes - continue reading

Comment on SCP / SSH recipes

Find to copy files into single directory

January 20, 2010 - 4:49 pm

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

Find to copy files into single directory - continue reading

Comment on Find to copy files into single directory

Search lister

December 30, 2009 - 12:56 pm

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…

Search lister - continue reading

Comment on Search lister

Linux/UNIX/Cygwin find command

December 30, 2009 - 11:16 am

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…

Linux/UNIX/Cygwin find command - continue reading

Comment on Linux/UNIX/Cygwin find command

How to set a static IP in Ubuntu from the shell

December 4, 2008 - 7:49 pm

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…

How to set a static IP in Ubuntu from the shell - continue reading

Comment on How to set a static IP in Ubuntu from the shell

Remastersys Notes

September 27, 2008 - 9:12 pm

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

Remastersys Notes - continue reading

Comment on Remastersys Notes

The all powerful find command

July 5, 2008 - 8:46 pm

find <starting point> <search criteria> <action>
The starting point is the name of the directory where find should start
looking for files. The find command examines all files in this
directory (and any subdirectories) to see if they meet the specified
search criteria. If any do, find performs the specified action on each
found file. Here are some of the…

The all powerful find command - continue reading

Comment on The all powerful find command

Another Linux Web MySQL Backup Script

July 5, 2008 - 8:45 pm

I found this on on the nixcraft craft. Looks pretty good to me. Similar
in functionality to my other script posted here. I’m going to poach
some concepts from here to make a script that will auto-optimize all
tables in all databases on the mysql server.
#!/bin/sh
##################
## jcz 17-feb-2007
## copied from http://www.cyberciti.biz/tips/
## how-to-backup-mysql-databases-web-server-
## files-to-a-ftp-server-automatically.html
##############################################
## System + MySQL backup script
##…

Another Linux Web MySQL Backup Script - continue reading

Comment on Another Linux Web MySQL Backup Script

gzip all directories in a directory

July 5, 2008 - 8:44 pm

I don’t know why I keep having to do this, but I do. I always to create
separate archives of all the directories in a directory. So, here is
script from David (aka Matir aka EmptyCinema) from linuxquestions.org http://www.linuxquestions.org/questions/showthread.php?s=&postid=1839513#post1839513
to do just that (along with a sample sessions using it).
#!/bin/bash
for dir in */
do dir=`echo…

gzip all directories in a directory - continue reading

Comment on gzip all directories in a directory

Top