How To Copy Directories and Subdirectories Recursively With FTP (scp)

When transferring file directory structures between linux / Unix hosts, usinf FTP was what came to mind.  FTP has been used for many transfers in the past, but when forced (read:allowed) to use the command line to transfer files, the MGET and other FTP related commands were useless. So google to the rescue, and up pops this great simple writeup about how to copy host-to-host using the SCP command. Sweetness defined.

In essence:

scp -vr -P 2222 ./* REMOTEUSERNAME@REMOTEHOSTNAME.TLD:/FULL/UNIX/PATH/TO/DESTINATION/FOLDER/(OR/FILENAMES.ABC)

This command will Verbosely and Recirsively do it’s thang. It will contact the remote host on port 2222 instead of the default port 22 used for SSH. The remote username is the unix username, and the remote hostname is the full DNS name or IP address of the remote unix box. The destination path is reltive to the root of the system, NOT relative to the user’s home dirtectory.

Have fun, and leave FTP for transferring single files or batches of files inside a single directory container only.

Posted under Freeware, Linux, Network

How to CHMOD on files but not directories (inodes)

From Linuxquestions.org:

“There are probably several methods, but one is to use find to produce a list of all files (not directories) and then execute chmod on each of them. For example

Code:
find /my/directory -type f -exec chmod 644 '{}' +

Change the red parts to fit your needs. If you wonder what that ‘{}’ is..well, you may have guessed that it’s where the filelist is being put when exec’ing the given command on each file.

You can also first try the command without chmod’ing to see that it affects the right files:

Code:
find /my/directory -type f

The above would find all regular files (not directories, for example) from within /my/directory.

If the command happens to throw you an error about the exec part, chances are it’s because of the plus sign (+) that ends the exec part. In this case try replacing the plus (+) with an escaped semicolon (\;) so it becomes

Code:
find /my/directory -type f -exec chmod 644 '{}' \;

On some machines I remember that it worked with semicolon (which needs a backslash in front of it, to protect it from being interpreted by your shell), but on my current installation it’s the plus sign (without a backslash).

Another way would probably be to list all regular files on the directory (using either find or any tool that can just list all files without directories) and then pipe the output to xargs with which the chmod was run.”

and from http://movabletripe.com/archive/recursively-chmod-directories-only/

June 19th, 2006

find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;

Posted under Linux

This post was written by Content Curator on October 17, 2009

Tags: , , , , , , , , , , , , , , , ,

Fedora 9 connect: Network is unreachable error

Ran across this installing Red Hat’s free Linux distribution Fedora Core 9 code named Suplhur. Installed totally vanilla install with the GUI anaconda front end. The box sees the NIC, and can ping within the local subnet of the LAN network, but can’t ping out. BTW, it holds a static IP on the network interface card (NIC). Gets the error:

connect: Network is unreachable error

We need to set a default route. Here’s how:

Looked in /etc/sysconfig/network-scripts for the file route-eth0 but it wasn’t there.

Using vi (you can use whichever text editor you prefer) I created that file route-eth0, and put in this one line:

defult via 192.168.0.1

(note: 192.168.0.1 is the LAN IP address of my router. Your router IP address may differ. So you should put in whatever the IP addres of your router is, instead. Most Netgear routers and Qwest DSL boradband modems use 192.168.0.1 and Linksys uses 192.168.1.1 and Belkin uses 192.168.2.1 just to name some common ones.)

Then a simple task of restarting the network and testing:

# service network restart
# ping yahoo.com

Success!

Also, I found that the ethernet adapters weren’t starting automatically. Using the GUI taskbar/ Start Menu, I went into System Administration, then into Services, and enabled the “network” service. Then change runlevel to 3. Ping works so eth0 is up, and that happened at the runlevel change. Change to runlevel 5, test, and… yeppers, it works.

Posted under Freeware, Linux, Network

OTRS login

By default, to login to a fresh OTRS install, the username is root@localhost and the password is root

Posted under Freeware, Linux

This post was written by Content Curator on December 4, 2007

Tags: , , , , , ,

Fix 403 Forbidden error in OTRS/Apache

This applies to (at least) OTRS 2.2 on Fedora Core 6 running Apache 2:

To fix this, change the following in the file /etc/httpd/conf.c/otrs.conf
Find the line that reads “Deny from All”, and comment it out by placing a # at the beginning of the line.

Save the file.

Restart Apache

# service httpd restart

Now try browsing your webserver otrs from other machines, success!

Posted under Linux, WebDev

This post was written by Content Curator on December 4, 2007

Tags: , , , , , , , , , , , ,

Set Windows clock to UTC time

Save the following lines as utc.reg, and then run it to import this registry tweak. It allows you to set the hardware clock in your PC’s BIOS to UTC time. This is handy for boot dual-booting Mac, or Linux, when those operating systems are set to read the BIOS clock as UTC time, instead of Windows’ preferred Local Time (ie. PST, PDT, MST, MDT, CST, CDT, EST, EDT, or the standard “GMT-” and “GMT+“)

Here is the code to save as utc.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
“RealTimeIsUniversal”=dword:00000001

Posted under Apple, Linux, Microsoft

This post was written by Content Curator on October 30, 2007

Tags: , , , , , , , , , , , , , , , , ,

How to Update Firefox on Fedora Core Linux

Using the yum command line usility:

yum -y –enablerepo=development update firefox

(there are two dashes preceding “enablerepo”)

When I used this line I got some transaction check failures thet looked something like:

file /usr/share/pkgconfig/gnome-doc-utils.pc from install of gnome-doc-utils-stylesheets-0.12.0-1.fc8 conflicts with file from package gnome-doc-utils-0.8.0-2.fc6

To fix this, I did the following:

yum -y –enablerepo=development update gnome-doc-utils

This updated the necessary packages, then I re-ran:

yum -y –enablerepo=development update firefox

Success!

Posted under Browsers, Freeware, Linux

This post was written by Content Curator on October 9, 2007

Tags: , , , , , , , , , , , , , , , , ,

How to set up DNS servers in Linux

Edit /etc/resolv.conf

Add the following:

nameserver 1.1.1.1

Posted under Linux

This post was written by Content Curator on July 17, 2007

Tags: , , , , , ,

Disable screen saver / blanking, in text-mode terminal, Linux

Thanks to Vivek’s page

To stop the screen from blanking:

# setterm -powersave off -blank 0

Posted under Linux

This post was written by Content Curator on March 9, 2007

Tags: , , , , , , , , , ,

Set time at command line in Linux

This works for all Linux flavors as far as I know:

The date command is used to set the system clock using the switch -s and the format MMDDhhmmYYYY (where MM=month, DD=day, hh=24-hour hour, mm=minute, YYYY=year)

The following example sets the date to January 5th 2007, 1:15 PM:

# date -s 010513152007

Posted under Linux

This post was written by Content Curator on March 9, 2007

Tags: , , , , , , , , , , , , ,