Remove DOS EOL ^M Character from File

endoflineIf you have the ^M character in your file, it is a Dos/Windows end of line character that is tough to get rid of. You could always ignore it, but the possibility of it corrupting a file is very high. Some editors such as Nano don’t even seem to show this character by default – maybe Nano strips it out – I’m not sure at this point.

If you are a vi warrior like I am, then you don’t really care for using Nano anyway. To remove the DOS EOL character using the vi editor, the easiest way is by following these steps:

vi filename

Press “:” to get to command mode.

Search and Replace all Globally is :%s/^M//g (Press control V then control M) which will replace ^M with nothing.

Then to write and quit enter “:wq”

In summary, here’s the command would look in vi:

vi filename
:%s/^M//g

If you need the character to actually turn into line breaks, try this:

vi filename
:%s/^M/\r/g

Installing Cisco PacketTracer 5.3.2 on 64-bit Ubuntu or Debian

!!IMPORTANT!!

This post is very old and outdated. I do not have access to the latest versions of Packet Tracer and therefore have no way to continue to assist with installation. If somebody has a recent copy of Packet Tracer they could provide to me, I would be happy to see if I can get it working and document the steps.


 

If you are trying to install Cisco’s PacketTracer on a 64-bit Linux dist, you would be suprised it isn’t supported…

BEFORE YOU DO ANYTHING, READ THIS WHOLE ENTIRE ARTICLE. AFTER YOU HAVE READ IT, READ IT AGAIN. AFTER THAT, READ THE COMMENTS AT THE END OF THE ARTICLE – THERE ARE SOME USEFUL ONES. NEXT FOLLOW THESE STEPS.

Please like and/or +1 this site if this article helped you! ~

UPDATE: This will now work on Debian, Crunchbang, Ubuntu, and any other Debian-based Linux Distro. I have found the key package to make it work and added it to the installation script.

Attn: Debian Users:

In order for this tutorial to work, you must be able to run the sudo command as done below, or you must run the code below to log in as root:

su -

Moving On

If you are trying to install Cisco’s PacketTracer on a 64-bit Linux dist, you would be suprised it isn’t supported, but we have found a workaround which did the job beautifully. This article applies to PacketTracer version 5.3.2 but may work on future versions as well.

I was originally going to write a tutorial to make this happen, however I figured a shell script would be just as easy to write. So follow these instructions:

Download the Files

Go to Cisco’s website at http://cisco.netacad.net, login, and download PacketTracer to your home directory (the directory which uses your name).

Next, download PacketTracerx64Hack.sh – it is the shell script that does all the work for you. Put this file in the same home directory where you downloaded PacketTracer.

Start the Installation of Packet Tracer

Open up gnome-terminal (or the terminal of your choice) and do this:

sudo sh PacketTracer532*

Hacking It to Force it to Install

Press Enter, Read through the agreement (or if you have before, just press the space bar until you hit 90% and then use the Enter key (DO NOT PRESS Y) to go the rest of the way down). Do NOT press anything else though. At this point, you will want to run the shell script that you downloaded (open up a new terminal to do this):

sudo sh PacketTracerx64Hack.sh

Installation Complete

It should do the rest of the work and then you can run PacketTracer by either going to the GUI menu > Internet > Cisco PacketTracer or by running the following:

/usr/local/PacketTracer5/packettracer

(the installer will initially run PacketTracer for you automatically)

If these instructions worked for you, please let me know in the comments section below. Also, don’t forget to +1 or Like us at the top-left of the page!

To Uninstall Packet Tracer

Uninstalling Packet Tracer is fairly easy. To do so, follow these steps:

sudo dpkg -r packettracer;
sudo dpkg -r getlibs

If there are errors when you try to uninstall or it says packetracer is not installed:

sudo dpkg --list | grep packettracer

You might see something like packettracer:i386. Therefore, replace the dpkg -r packettracer command with the following (make sure to be root or use sudo):

dpkg -r packettracer:i386

Installing Debian on Dell XPS L501X

All of the basic requirements for the L501X to work on Debian are here…

The following article is “mirrored” here because last time I went to check it, it no longer existed. I recovered it from Google’s cached copy (Thanks Google!)

Written by AMLJ
Friday, 28 January 2011 06:38

Hi! I just bought a Dell XPS L501X laptop, and hopefully, after some pain got everything to work! Wanted to make it easier for people who might be next!

This is actually tested on Squeeze, but I think, and I hope, and I’m kinda sure it will work with Lenny too!

So, let’s start…

If you use an old image for installation, you will have problem, even with getting the wired connection to work during the installation… For me, it didn’t work afterwards too… Be sure to download a new image. (Right now Release Candidate 2)

So, you need a wired connection, oh well, you might as well get the wireless to work by giving the installer what it asks for, but I couldn’t!

Now… You finish the installation, there is no wireless, and Debian greets you with a 800×600 resolution! I thought my eyes are not seeing well at first! No need to worry!

For wireless issue, see http://wiki.debian.org/iwlagn.

Nvidia Graphics

Open a terminal and…

 su -
 [Enter root password]
 apt-get install gcc make linux-headers-`uname -r` build-essential

If I’m right, that’s all you need, but there might be something else you need, if so, please leave a comment so I would edit this too! (I can also help you if you didn’t know what to install)

Now, download the driver from http://www.nvidia.com/object/linux-display-amd64-260.19.36-driver.html.

Go to the terminal emulator again, and after reading what you need to do, do this:

 /etc/init.d/gdm3 stop [Change gmd3 to kdm, or whatever else if you are using them)

[Now press Alt+Right Directional Key]

 cd /home/[Your username]/Downloads [You need to go to the directory which that file is in, so the path may change
 chmod 770 NVIDIA-Linux-x86_64-260.19.36
 ./NVIDIA-Linux-x86_64-260.19.36

Now, you might get the error about gcc… Don’t abort the installation. Other steps are easy (if you got any errors and didn’t know what to do, leave a comment), and as the last step, it will ask something regarding nvidia-xconfig… Choose yes.

Now:

 /etc/init.d/gdm3 start && exit [As mentioned earlier, gdm3 can change]mkdir /usr/src/alsa

Now, the resolution should be OK! So let’s solve the next problem!

No sound through the damn great speakers? Download the alsa-drivers package from http://www.alsa-project.org/snapshot/files/ (avoid the July of 2011 snapshot like the plague!!), and copy it to /usr/src/alsa:

 cp alsa-d* /usr/src/alsa

Now go there, and unzip the package:

 cd /usr/src/alsa
 tar jxvf alsa-d*
 cd alsa-*

Now, you need to compile this:

 ./configure --with-cards=hda-intel --with-sequencer=yes ; make ; make install

If it all goes well, you will see something about the sound being muted by default and so on…

Now, reboot!

That’s it, next time you must have sounds… And that’s not all, the mic will work now as well, and also, the headphones and all that (I tried downloading all those packages and compiling, and therefore none of these worked, I only got the sound first time)

Oh, you might want to remove that NVIDIA logo, as well!

You need to edit /etc/X11/xorg.conf… In order to do that, I always suggest VIM, but well, that’s not so easy to use for some, so you can try Nano.

 nano /etc/X11/xorg.conf

You will see a part like this:

 Section "Device"
 Identifier "Device0"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 EndSection

After VendorName, and before EndSection, paste this into a new line:

 Option "NoLogo" "true"

Now, that part should look like this:

 Section "Device"
 Identifier "Device0"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 Option "NoLogo" "true"
 EndSection

That’s it, we got rid of that one as well!

Next problem is suspend… It doesn’t work for you does it? Well, I haven’t found a clean solution, but it works… When you want to suspend, run this:

 rmmod xhci

Now hibernate. And afterwards:

 modprobe xhci

For example, you can try the F1 button for this one… Add a shortcut, so that when you press that “gksu rmmod xhci” would be executed, and when you press Ctrl+F1 “gksu modprobe xhci”.

What I have done, is to make the screen locked right after suspend, and when the password is entered, the next command which is executed it the above.

The other problem which I had forgotten to mention, and thanks to “AdanOva” I remembered, is the F keys, and the combination of Fn and them… The F1 to F12 keys, do not work as expected. They always work, as if you are using them with the Fn keys. So, for example, if you want to increase the screen brightness, just press F5… Now, if you want to actually use the F1-12 keys, you should hold Fn and then press them…

So, if you should normally press Fn+F1, just press F1, and if you should normally press F1, you have got to press Fn+F1! (Funny!)

Last thing I can think of, is Flash Player. I am trying the native 64-bit version now! (Square)

Download it from http://labs.adobe.com/downloads/flashplayer10_square.html, and then extract it. You will see a file. Now copy it to where you should using this command:

 cp libflashplayer.so /usr/lib64/mozilla/plugins/

*NOTES*

1- Unfortunately, some don’t understand that those who need these drivers, and something like Flash Player, are not the governments, and are the people. So, if you are from a country like Iran you won’t be able to download these. If you need these, and can’t download them, leave a comment, with your e-mail and I’ll send a mail to you and will attach these, or find another way to give them to you. I hope we see a day when normal people would not have these kind of problems just because of the choices the governments make.

2- Doing this for 32-bit Debian is also very easy, you just need to download the 32-bit NVIDIA driver, and 32-bit Flash Player (Easier to find than the 64-bit version!)

3- If you had any problems, you can ask, and I hope I’d be able to help!

Have fun!

javascript return confirm() – user redirection

The javascript “confirm” script is used on a webpage where you need to give the user a choice. If they press the OK button in the popup, it redirects them. If they press cancel, then it cancels the script and leaves things as is.

<script type="text/javascript">
 <!--
 function confirmation() {
   var answer = confirm("Put pop up window message here")
   if (answer){
     window.location = "url for user after they pushed ok";
   }else{
     window.location = "url for user after they pushed cancel";
   }
 }
 //-->
 </script>