Suramya's Blog : Welcome to my crazy life…

September 18, 2011

How to set different backgrounds for each desktop in KDE 4.6.5

Filed under: Computer Tips,Linux/Unix Related,Tech Related — Suramya @ 11:59 PM

I have talked about How to set different backgrounds for each desktop in KDE4 in a previous post. However in KDE 4.6.5 the previous steps no longer work, so posting the new steps to get different backgrounds in KDE:

  • Click on the ‘Start Menu’ (The K at the bottom Right of the screen)
  • Click on ‘System Settings’ under the Settings menu
  • Double Click on the ‘Workspace Behavior’ under the “Workspace Appearance and Behavior” section
  • Check the “Different widgets for each desktop”
  • Click Apply

That’s it. Now you can change the wallpaper by Right clicking on the desktop and selecting ‘Desktop Settings’. Its good to know that the KDE Developers paid attention to complaints that the users made about their software and addressed it.

– Suramya

May 18, 2010

Boot From a USB Drive even when your BIOS Won’t Let You

Filed under: Computer Software,Computer Tips,Tech Related — Suramya @ 11:37 PM

If you are like me then you have gotten into the habit of carrying a Live Linux CD with you at times, I keep mine in my Laptop bag so its there when I need it. However CD’s have a lot of inherent problems like, an inability to update the version without burning a new disk and a susceptibility to scratches.

Having a Bootable USB drive with the latest version of Linux solves all these problems. USB drives are quite cheap now and it makes sense to have one available loaded with the latest diagnostic tools. But till date I didn’t carry a bootable USB drive with me because a lot of the systems I encountered didn’t allow me to boot from USB which made the bootable drive pretty much useless. Now, there is a way to fix the problem. What you need is a Blank CD and the latest version of PLoP.

PLoP is a Bootmanager that allows you to create a boot CD that will enable the system to boot from a USB drive even when that option is not supported by the BIOS. You can download PLoP from here. Installing it is quite easy. You just need to extract the .ZIP file that you downloaded and burn the .iso image to a CD. There are two ISO images on the CD and you can use either one of them, however according to the readme file plpbtnoemul.iso should work “everywhere” so if you have some doubt use that image.

Once you burn the image to the CD, reboot the system and configure it to boot off the CD. When the system boots up you will get a boot menu that will allow you to choose USB as the device to boot from. Once you do that the system will boot off the USB drive as normal and you can proceed from there.

Hope you find this as helpful as I am going to.

– Suramya

Source: Boot From a USB Drive Even if your BIOS Won’t Let You – How-To Geek.

September 3, 2009

Sort a file list by Date in Linux (Including Subdirectories)

Filed under: Computer Tips,Linux/Unix Related,Tech Related — Suramya @ 7:35 PM

I use Amarok to play music and I really like it, however my Playlist was created in Winamp/XMMS which I initially thought that Amarok couldn’t read. So all the new music I got since I switched to Amarok was no longer being added to a playlist, I just added the new songs manually then used the select 50 random songs option to play music.

Yesterday I figured out that Amarok does indeed read .m3u files (Winamp Play lists) so I wanted to add all the new music I have to the top of the old playlist. So basically I needed a list of all music in my system sorted by date. If you have been using Linux and are reasonably familiar with it then I think the first thing that came to your mind must have been: “Why can’t we just use ls -lRrt”? That’s pretty much what I thought. But unfortunately this command doesn’t work very well for what I wanted to do.

After playing around for a while I finally managed to get the system to show me a list of all music files in my system sorted in reverse chronological order. The command I used for this is:

find -name "*.mp3" -print0 | xargs -0 stat --format '%Y %n'|sort -r

Now the explanation:

  • find -name “*.mp3” : returns a list of all mp3 files in the current directory and any subdirectory under it.
  • -print0: This tells find to use the ASCII NUL character instead of space to separate the filenames. If we don’t use this then xargs chokes on the spaces in file names.
  • xargs -0: This tells xargs to use the ASCII NUL character instead of space to separate the filenames.
  • stat –format ‘%Y %n’: This runs the stat command on every file returned by find. This command returns the Time of last modification as seconds since Epoch followed by the name of the file.

    e.g.

    suramya@Wyrm:~$ stat --format '%Y %n' unison.log
    1251802152 unison.log

  • sort -r: sorts the list using the first column (the creation time) and displays the result.

——-

Example execution result in my Scripts directory:

suramya@Wyrm:~/bin$ ls -l
total 2648
-rwx------ 1 suramya suramya      77 2009-01-10 04:30 bookfixer.sh
-rwx------ 1 suramya suramya      76 2009-01-10 04:30 cardDesigner.sh
-rwx------ 1 suramya suramya     548 2009-01-10 04:30 change_wan.sh
-rwx------ 1 suramya suramya     478 2009-01-10 04:30 compare_entire_dir.sh
-rwx------ 1 suramya suramya    3462 2009-01-10 04:30 delay.pl
-rwx------ 1 suramya suramya      66 2009-01-10 04:30 EditPlus
-rwx------ 1 suramya suramya      88 2009-01-10 04:30 export_xterm
-rwx------ 1 suramya suramya     203 2009-01-30 04:29 extract.sh
-rwx------ 1 suramya suramya   82558 2009-01-10 04:30 lit2html
-rwx------ 1 suramya suramya     320 2009-01-10 04:30 makedir.sh
-rwx------ 1 suramya suramya      49 2009-01-10 04:30 mapsql
-rwx------ 1 suramya suramya     369 2009-01-15 02:11 MuteUnmute.sh
-rwx------ 1 suramya suramya 2350194 2009-01-10 04:30 pdftohtml
drwx------ 2 suramya suramya    4096 2009-01-10 04:30 Poet
drwx------ 2 suramya suramya    4096 2009-01-10 04:30 Remote
-rwx------ 1 suramya suramya     109 2009-02-08 19:47 resize.sh
-rwx------ 1 suramya suramya      48 2009-01-10 04:30 rootscan
-rwx------ 1 suramya suramya     397 2009-01-10 04:30 S41firewall
-rwx------ 1 suramya suramya     111 2009-02-21 20:15 sync_website.sh
-rwx------ 1 suramya suramya     116 2009-01-10 04:30 text2img
-rwx------ 1 suramya suramya     122 2009-01-10 04:30 uncompress.sh
-rwx------ 1 suramya suramya  180580 2009-01-10 04:30 vcdgear


suramya@Wyrm:~/bin$ find -name "*" -print0 | xargs -0 stat --format '%Y %n'|sort -r
1235227520 ./sync_website.sh
1235227520 .
1234102660 ./resize.sh
1233269990 ./extract.sh
1231965676 ./MuteUnmute.sh
1231542033 ./vcdgear
1231542033 ./uncompress.sh
1231542033 ./text2img
1231542033 ./S41firewall
1231542033 ./rootscan
1231542033 ./Remote/StarFlight
1231542033 ./Remote/Firestorm
1231542033 ./Remote/CyberNibble
1231542033 ./Remote
1231542033 ./Poet/poet.tar.gz
1231542033 ./Poet
1231542033 ./pdftohtml
1231542033 ./mapsql
1231542033 ./makedir.sh
1231542033 ./lit2html
1231542033 ./export_xterm
1231542033 ./EditPlus
1231542033 ./delay.pl
1231542033 ./compare_entire_dir.sh
1231542033 ./change_wan.sh
1231542033 ./cardDesigner.sh
1231542033 ./bookfixer.sh

As you can see, the ‘sync_website.sh’ script is the latest script in that directory.

Hope you find it useful.

– Suramya

April 21, 2008

Getting my wireless card working in Debian

Filed under: Computer Tips,Knowledgebase,Linux/Unix Related,Tech Related — Suramya @ 2:03 AM

As promised here are the steps that I followed to get my wireless card working on my Comaq Presario V3000 in Debian:

1. Install ndiswrapper

In my case I allready had the ndis wrapper installed. If thats not the case with your system run the following command as root to install it:

apt-get install ndiswrapper-common ndiswrapper-utils ndisgtk

2. Disable the “bcm43xx” driver on your system

Run the following command at a command prompt as root :

echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist

3. Download the Windows driver for your card

My system uses the Broadcom Corporation BCM4310 card and I had to download the Windows driver for it from the Dell site. For some reason the driver I found at the Compaq site refused to work. You can download it from here.

Save this in the /tmp directory cd into the /tmp directory, and unzip the Windows driver package:

cd /tmp
unzip R123456.EXE (or whatever the name of the download is)

4. Install the Windows driver with ndiswrapper

To load the driver you need to run the following command as root:

ndiswrapper -i /tmp/DRIVER/bcmwl5.inf

The you should verify that the driver has been successfully loaded

ndiswrapper -l

The output of this command should look like the following if it is loaded correctly

Installed ndis drivers:
{name of driver} driver present, hardware present

or

{name of driver} : driver installed
device ({Chipset ID}) present

5. Load the ndiswrapper module

You now need to load the ndiswrapper module. Run the following steps at a command prompt as root:

depmod -a
modprobe ndiswrapper

if the above commands don’t give any errors then the drivers have been successfully installed.

6. Configure the wireless card

I have found the ‘netcardconfig’ command the easiest to use when configuring a new card. Run it as root and answer the questions it asks and it will configure the card for you.

7. Set the ndiswrapper module to automatically load at boot

ndiswrapper is not started by default when the system starts up so you must configure your system to load the ndiswrapper module at system startup. To do this, edit /etc/modules file as root to add an entry for ndiswrapper at the end of the file.

vi /etc/modules

Add ‘ndiswrapper’ (without the quotes) to the end of the file in a new line. Save and exit.

Now the module will be loaded when the system next starts up.
—-

A special thanks to JamesGu from the UbuntuForums for figuring out the solution and posting it there.

Hope you find this useful. I certainly did. 😉

Will post about my sound card next.

– Suramya

February 12, 2008

Regular Expressions Cheat Sheet

Filed under: Computer Tips,Knowledgebase,Tech Related — Suramya @ 9:52 PM

The Regular Expressions cheat sheet is designed to be printed on an A4 sheet of paper and live by a designer or developer’s desk, to make life a bit easier.

regular_expressions_cheat_sheet.png
Regular Expressions Cheat Sheet

Check out this post for a description of what is on the cheat sheet.

– Suramya

October 3, 2007

Automatic session logging/monitoring with GNU screen

Filed under: Computer Security,Computer Tips,Security Tutorials,Tech Related — Suramya @ 11:10 PM

Found this good article on how to setup screen on Linux/Unix so that it automatically logs all activity made in the session. Screen is a utility that I use very often on my Linux box. Basically its a program that you start and it attaches to a specific console and if you ever get disconnected you don’t loose your work/position, all you have to do is log back in and reconnect to that screen. You can also connect to a system via ssh/telnet and start a program then disconnect from ssh then move to another location and reconnect to server and join the same session from there. I use it all the time when compiling stuff or downloading large files.

The main issue I had with screen was that it would only keep 20-30 lines in the history so if you wanted to scroll up to read the previous logs you couldn’t. Now this article explains how to set up logging so that you can do that. For the impatient here’s how you do it:

I wanted to automattically launch a screen session when somone logged in so if I happened to be on the server I could monitor them in real time. I also wanted a log of the session in case I wanted to look over it later or if I was not able to monitor the session live.

I ended up adding the following to my .bashrc

# — if $STARTED_SCREEN is set, don’t try it again, to avoid looping
# if screen fails for some reason.
if [[ “$PS1″ && “${STARTED_SCREEN:-No}” = No && “${SSH_TTY:-No}” != No ]]; then
STARTED_SCREEN=1 ; export STARTED_SCREEN
if [ -d $HOME/log/screen-logs ]; then
sleep 1
screen -RR && exit 0
# normally, execution of this rc script ends here…
echo “Screen failed! continuing with normal bash startup”
else
mkdir -p $HOME/log/screen-logs
fi
# [end of auto-screen snippet]

and add the following to your .screenrc

# support color X terminals
termcap xterm ‘XT:AF=E[3%dm:AB=E[4%dm:AX’
terminfo xterm ‘XT:AF=E[3%p1%dm:AB=E[4%p1%dm:AX’
termcapinfo xterm ‘XT:AF=E[3%p1%dm:AB=E[4%p1%dm:AX:hs:ts=E]2;:fs=07:ds=E]2;screen07′
termcap xtermc ‘XT:AF=E[3%dm:AB=E[4%dm:AX’
terminfo xtermc ‘XT:AF=E[3%p1%dm:AB=E[4%p1%dm:AX’
termcapinfo xtermc ‘XT:AF=E[3%p1%dm:AB=E[4%p1%dm:AX:hs:ts=E]2;:fs=07:ds=E]2;screen07′

# detach on hangup
autodetach on
# no startup msg
startup_message off
# always use a login shell
shell -$SHELL

# auto-log
logfile $HOME/log/screen-logs/%Y%m%d-%n.log
deflog on

Keep in mind that this is not a very secure setup. Anyone with any technical knowledge can edit the logs as they are located in the user’s home directory and are editable by them. So don’t rely on it extensively to keep a system secure.

Complete article is available here: Automatic session logging and monitoring with GNU screen for the paranoid.

Thanks,
Suramya

July 6, 2007

Allow passwordless access to a subfolder of a password protected directory

Filed under: Computer Tips,Knowledgebase — Suramya @ 2:22 PM

Hey,
We have a directory on the server thats password protected and we needed to give access to a subdirectory of that folder to everyone (Without having them enter a password). Turns out it is possible to do so using .htaccess

Create a .htaccess file in the subfolder that you want to give full access to with the following content:

AuthType none
Satisfy any

Save and exit. This overrides the password protection of the parent folder and gives anonymous access to the folder.

Thanks to Vinit for the tip.

– Suramya

June 24, 2007

Getting a 404 error in asp.net when the file exists on the server

Filed under: Computer Software,Computer Tips,Knowledgebase,Tech Related — Suramya @ 1:25 PM

Hit this issue recently on a web server that I was setting up on Windows 2003 server using IIS. Now everything was installed correctly and I had copied all the files to the server, then I created a virtual directory for my asp.net application and when I went to http://localhost/Test it would show me the directory listing (Yes I had enabled that so that I could debug). However when I clicked on the service.asmx file it would tell me that the file didn’t exist and I would get a 404 error. Now I knew that the file was there and I could see it in the directory listing but for some reason the IIS refused to show it.

The problem was caused because the server was running the 64 bit version of ASP.NET 2.0 while we were expecting the 32 bit version. Yes, it took me a couple of hours to figure that out. To fix it basically what you have to do is tell IIS that you want to use the 32 bit version for this particular Virtual Directory by changing the Script Map. The steps to change this are:

  • Open the IIS management console.
  • Expand the local computer node, expand Web Sites, and then expand Default Web Server.
  • Right-click the folder for the application, and then click Properties.
  • On the Directory tab, click Configuration.
  • The Application Configuration dialog box appears.
    On the Mappings tab, select an ASP.NET application extension, such as .asmx or .aspx.

    The Executable Path column of the dialog box lists the path to the ASP.NET ISAPI extension used by the application. By default, the ASP.NET ISAPI extension is installed in the following location:

    %system root%\Microsoft.NET\Framework\versionNumber. Browse to the appropriate directory and select the aspnet_isapi.dll file.

  • Click Ok and exit
  • Finally Stop and Start the webserver for the changes to take effect.

Now you should be able to access the files on the server without issues.

BTW, also make sure that the user IIS is running as also has permissions to read files and execute scripts in the directory where you have copied your files.

Hope fully you found this helpful.

Source for the steps to change the mapping: How to: Configure ASP.NET Applications for an ASP.NET Version

Thanks,
Suramya

April 26, 2007

Status update on my computer issues and my workarounds

Filed under: Computer Tips,My Life — Suramya @ 12:44 PM

As I had posted earlier my laptop was having issues after I got the fan fixed on the system. Now it keeps shutting down randomly anywhere from a min to 15 mins after startup. I have given it to a shop for repair and I am supposed to get it back tomorrow. Keeping my fingers crossed that it will get fixed.

My Dad’s laptop is still having the same issues as earlier (Windows install is messed up on it, Cut and paste doesn’t work. Apps refuse to start etc) but I won’t be messing with it till I get my laptop back. Since the issues got really annoying I started remote desktoping into my desktop from the laptop to work and thats been working really well. Unfortunately the XP on the laptop has gotten into such a state in the past two days that I can’t use rdp on it either. So I decided to avoid windows alltogether and booted off a Knoppix Live Linux CD on the laptop and am using rdesktop on it to access the server (My desktop). So far its working great.

I even got sound working on RDP. I can now play music on the desktop and listen to it on the laptop via RDP. Here’s the command I used to get it working:

rdesktop -r sound -z -x l -f -a 16 192.168.15.10

where:

-r sound:[local|off|remote]
Redirects sound generated on the server to the client. “remote” only has any effect when you connect to the console with the -0 option. (Requires Windows XP or newer).

-z
Enable compression of the RDP datastream.

-x
Changes default bandwidth performance behaviour for RDP5. By default only theming is enabled, and all other options are disabled (corresponding to modem (56 Kbps)). Setting experience to b[roadband] enables menu animations and full window dragging. Setting experience to l[an] will also enable the desktop wallpaper. Setting experience to m[odem] disables all (including themes). Experience can also be a hexidecimal number containing the flags.

-f
Enable fullscreen mode. This overrides the window manager and causes the rdesktop window to fully cover the current screen. Fullscreen mode can be toggled at any time using Ctrl-Alt-Enter.

-a
Sets the colour depth for the connection (8, 15, 16 or 24). More than 8 bpp are only supported when connecting to Windows XP (up to 16 bpp) or newer. Note that the colour depth may also be limited by the server configuration.


I also installed EXT2IFS on the server so that I can get access to my ext3 partitions from windows. This program provides Windows NT4.0/2000/XP/2003 with full access to Linux Ext2/Ext3 volumes by allocating drive letters to the volumes. This means all software installed on the system can access the partitions. Its really cool. Haven’t hit any issues with it so far…

So after installing all this stuff I can work without any major issues. But I still want my laptop back.

Well this is all for now. Hopefully I will get my system back soon.

– Suramya

December 29, 2006

Sending an e-mail to users whose password is about to expire

Filed under: Computer Tips,Knowledgebase — Suramya @ 4:15 PM

If you have users that don’t login to a windows system or Outlook Web access and just use POP/IMAP to download emails then you must be used to having these people call in to have their passwords reset when their passwords expire which can be a pain.

The following script sends out an email to Exchange users when their passwords are about to expire so that they can login to change their password and not bother you.

Download the script from here: Sending an e-mail to users whose password is about to expire

Will post the script to do the same on Unix/Linux systems later.

Thanks,
Suramya

PS: I DIDN’T WRITE THE SCRIPT SO IF IT DESTROYS YOUR SYSTEM DON’T BLAME ME.

« Newer PostsOlder Posts »

Powered by WordPress