Κυριακή 5 Φεβρουαρίου 2017

Installing Samsung printers to KDE linux (e.g. KUbuntu)

Recently I tried to install my C410W Samsung printer to my newly installed KUbuntu 16.10.

The problem:
I found the drivers (from here) and run the ./install-printer.sh script as a superuser (sudo).

Unfortunately, in the Printers application of KDE, I could not see any configured printers and the newly installed printer was not found under the print menu of any applications.

The solution:
After downloading the printer drivers and extracting them (e.g. in your ~/Downloads/uld directory), follow the steps below:

  1.  Open  "System Settings->Printers"
  2.  "Add Printer"
  3. Select your pinter from the list (on the left - see below)
  4. Select "Manually Provide PPD file" and browse to the following location: "/uld/noarch/share/ppd/" and select the file corresponding to your printer. 
That's all, you should be done and dusted, you can print a test page to be on the safe side.

 

Κυριακή 5 Ιουνίου 2016

INACCESSIBLE_BOOT_DEVICE after BIOS restore using RAID

Below is the resolution to a problem that I have faced several times and took me ages to resolve (each time). Now, I decided to document the solution, so that either myself or anyone else who comes across this problem in the future can resolve it.

The problem
You have a RAID configuration (mine was RAID 0, but I guess the same applied to RAID 1) and you have had to restore the original settings on your BIOS. Then your system booted up without recognizing the RAID volume.

You then try to enable the RAID settings in the BIOS, but unfortunately Windows 10 fails to load with a sad face and the following error:

INACCESSIBLE_BOOT_DEVICE
The solution
Before describing the solution, here is the root cause of the problem:

Once you started Windows 10 in ACHI (or IDE) mode (i.e. with RAID disabled after you used the default values of the BIOS), Windows did not load the RAID drivers. Therefore, the next time you try to start Windows with RAID, it fails to find the RAID volume. Here is how to solve it.

  1. Start Windows 10 up using ACHI or IDE mode (i.e. no RAID support). 
  2. Use Windows Key + R and run msconfig
  3. Select Safe Mode from the boot menu and restart
  4. Enable in BIOS the RAID configuration 
  5. Windows will start up with RAID enabled but in Safe Mode. This will load the RAID drivers though
  6. Use Windows Key + R and run msconfig again to Disable the Safe Mode this time 
  7. Reboot 
  8. You should be ok now
Please share if you think that this is useful.

Τετάρτη 16 Ιουλίου 2008

Linux Media Server

Nowadays, many people may have an old PC around that they don't really use. One of the things that you can do with it is to convert it into a "media server". Doing this, may provide you with a platform from where you can listen to your music collection remotely, download staff etc.

In this article I will first list what I believe that we can add to our media server. I really want to see your comments regarding other things that you would like to see on our media server. Then I will go on to describe how we can actually set one up.

The basics:
The OS that we will use on our media server will be "Linux". More specifically I will use Ubuntu 8.04LTS as this currently my favorite distro. However, note that I will be using the Server edition (meaning no GUI).

The initial content of the media server (please add to this list using the comments):
  1. Ability to stream media files over the network - Jinzora
  2. Ability to download torrents with a nice web interface - rTorrent & rtgui
  3. Ability to share files over the network between Linux and Windows machines - SAMBA
  4. Ability to remotely manage every aspect of our media server - Webmin
  5. Manage Remotely databases - phpAdmin
  6. ...
  7. ...

Τρίτη 15 Ιουλίου 2008

How to get line by line read of "ls" in bash

The problem:

I wanted to write a bash script that will read the output of 'ls' in a directory and rename each file that matched a specific pattern. However I soon found out that using

for line in ls

was no good as it returned the output word by word.

The solution:

The problem was solved after a bit of googling. The code that I needed was:
ls | while read lineVar
do
...
...
done
What this does:

1. ls pipes its output into "while read" which read line by line and stores each line into $lineVar (you don't need the dollar initially).
2. In the while/do loop I can do the pattern matching using sed and renaming.

The full script (currently with no terminal input - it's all hardcoded):
#!/bin/bash

ls | while read lineVar
do
echo OLD: $lineVar
new=`echo $lineVar | sed -e 's/^.....//g'`
echo Replacing $lineVar with $new
mv "$lineVar" "$new"
done
Hope this helps

Παρασκευή 11 Ιουλίου 2008

How to block a specific IP or Hostname from accessing your web-site using htaccess

Recently I figured out that someone was accessing repeatedly a specific url of my web-site causing a huge amount of traffic which finally resulted to a warning from my provider for exceeding the available to me bandwidth. So, I had to block that someone.

There were two steps involved in this process:
  1. Identify the offender
  2. Block the offender
Identifying the offender was simple using the server logs which are being analyzed by webalizer (but any other similar tool would do).

Having identified the offender (I had the offender's host name) I had to ban it from the site.

My provider does not give me access to a httpd.conf (I am using shared hosting) so I had to use .htaccess file in the webroot of my site. Below are the steps I followed:

  1. Create a .htaccess file in the webroot of your site (usually in /httpdocs)
  2. In the .htaccess file add the following lines:
order allow,deny
deny from hostname.com
deny from xxx.xxx.xxx.xxx
allow from all
In the above replace the values in italics with the actual that you want to ban (tip: to get the ip address you can just ping the hostname and will resolve to the ip address)

Finally save the file and you should be ready.