Category: Fedora

Managing your remote site locally – sitecopy.

If you are managing a remote site, web server that you do not have direct access to (terminal or ssh) and you have to do it with cpanel, then I know how much pain it is. I had the same issue until recently when I discovered sitecopy.

Description of sitecopy:

sitecopy allows you to easily maintain remote Web sites.  The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site, with a single command. sitecopy will also optionally try to spot files you move locally, and move them remotely.  FTP and WebDAV servers are supported.

Now that\’s interesting. So how to use sitecopy. I will give you a step by step guide. If you are running Fedora, the package is in the Fedora repo.

So, Lets first install the package :

sudo yum install sitecopy

Once that is done, we need to create a rc file to direct the sites:

site amit –>> Just a name for sitecopy to recognize this site.
server amit-agarwal.co.in –>> The server
remote /  ->> Path on the server to manage
local sitecopy –>> the local path for storage of the files.
username xxxx –>> the username for the site
password xxxx –>> the password for the site
url http://amit-agarwal.co.in –>> URL of the site
protocol ftp –> The protocol to use by sitecopy, webdav also can be used.

Put the above file in the home folder as .sitecopyrc. Then change the permission to 0600. Create a folder called .sitecopy and change the permission to 0700. That much for the configuration. Now create the destination storage folder specified in the local configuration above and change the folder permission to 0700. You are ready to go.

Initialize the site:

sitecopy -i

Then update the site:

sitecopy -s amit

This is supposed to synchronize the local folder with the remote folder but I found that the command did not create the directories recursively, so did a little hack and ran the below to do a complete copy:

sitecopy -s ; while [ $? == 1 ] do sitecopy -s amit; done;

This will complete the initial set of directories for you and then whenever you want to sync the local directory you can run

sitecopy -s amit

and when you make changes locally you can update the site with

sitecopy -u amit

Diary and Journal on your linux Desktop

RedNotebook is a diary and journel for the *nix OS. This is a great software with some very good features.

This is available on fedora repo and hence to install you can just type:

sudo yum install rednotebook

Some features to note are:

  • Enter text for individual days and navigate using a fancy calendar
  • Add Categories to days and fill them with small content
  • Tag your entries
  • Format your text bold, italic or underlined
  • Insert Images, files and links to websites
  • Links and mail addresses are recognized automatically
  • (Live-) Search
  • Automatic saving
  • Backup to zip archive
  • Word Clouds with most often used words and tags
  • Create a template for each day
  • Export the journal to HTML, Latex or plain text
  • RedNotebook is Open Source Software, you are free to use and redistribute it under the terms of the GPL

MinGW – compile windows software on Linux

For all the windows developer out there, it is impossible to switch to Linux just because someone is looking for the Windows exe. Sooooooo bad. Not any more. There has been the MinGW compiler (and others) to compile the C programs on Linux box to run on Windows box. These cross compilers create windows exe and thus these can run on Windows natively without additional dll\’s. That\’s quite good, so how to do it.

Here\’s how:

Fedora has decided to include the cross compiler in the repository . Login as root and do the following:

yum install mingw32-gcc mingw32-binutils mingw32-gtk2 mingw32-gtk-vnc mingw32-libvirt mingw32-libxml2 mingw32-nsis mingw32-nsiswrapper

This will install the required rpms to get you started. Now the part about getting started and getting software to run on windows. To get the programs compiled for windows, you can follow the simple guide here. This guide talks about compiling the software when the configure script is available.

But otherwise if you have a simple C or cpp to compile you can simply use the mingw compiler to compile the program and you get the exe that you can try out with wine or run on windows machine. Happy coding.

Example of the coding and compiling:

cat <<EOF > a.c

#include <stdio.h>
int main()
{
printf(\”Amit Agarwal \\n\”);
}
EOF

i686-pc-mingw32-gcc a.c

wine a.exe