Categories
Linux Solutions

Kate: Not allowing to Edit Specific Files – Solution



Recently I encountered an interesting problem with Kate. When ever I opened certain files it opened them in read only mode. The files had the necessary permissions to let me write and I could open them in nano or vim and edit them successfully.

There can be multiple reasons for this happening:

  • File is in use in some program (known to cause problems with Kate)
  • File is a PHP file and being accessed somewhere
  • File has more than 1024 characters in a line. (The limit might vary but after a point the files are opened as read only)
Categories
Linux Solutions

Compressing files in Linux & Unix – Cheat Sheet

Here is a quick cheat-sheet on How To Compress files in Linux & Unix

Zip
zip archive file1 file2 file3
Compresses file1 file2 file3 into an achive with filename archive.zip

zip archive *
Compresses all files in the current directory into an achive with filename archive.zip

zip -r archive dir
Compresses the directory dir(and its subdirectories) into an achive with filename archive.zip

unzip archive.zip
Uncompresses the archive archive.zip to the current directory

unzip archive.zip -d dir
Uncompresses the archive archive.zip to the directory dir

Categories
Solutions Windows

Protect your Thumb Drive from Viruses using a Simple Hack



One of the easiest ways for getting your system infected with viruses is by using infected thumbdrives.  Most viruses create a startup file with the name “autorun.inf” and in the file point to the location of the virus(within the drive) to be run automatically when the thumb drive is detected.

Most Antivirus programs detect these viruses but there is a simple hack that can be used to prevent these Autorun viruses from infecting your drive.

All you need to do is:

  1. Delete the “autorun.inf” file in the root folder of your thumb drive(if the file exists)
  2. Create a new folder with the name” autorun.inf” in the root folder of the thumb drive

How does this work?
Well most viruses create the autorun.inf file when the thumb drive is inserted, by creating a folder with the same name the virus cannot create the file. Also since its a folder its not straightforward to delete and replace it(thank you Fat32 filesystem)

Ps: This hack works with most common viruses but its still recomended that you have an updated antivirus program to faithfully protect your system against virus attacks.

Enhanced by Zemanta