Acer Aspire 5336 backlight fix for openSUSE

May 19th, 2013 by Ish No comments »

This tutorial shows how to fix the backlight issue in Acer Aspire 5336 notebooks.

When booting your Live/Installation DVD add the following boot options to the grub menu :

acpi_backlight=vendor acpi_osi=Linux

acer-aspire-backlight-issue

Press enter to let the boot process continue.

When the screen turns black press the Fn key along with the brightness button.

fnplusbrightness

Once installation is complete verify your grub configuration (/boot/grub2/grub.cfg) to see if the acpi options have been added. The grub entry should look like this :

acpi-settings

If not, add them and update grub.

Now, to eliminate the need of pressing the fn combination we can add the following lines in the /etc/init.d/boot.local file.

while [ true ]; do sleep 1
sudo setpci -s 00:02:0 F4.B=0
done

Thus every time the system boots, the brightness setting will be triggered and backlight is switched on.

Project Evil Genius version 1

May 18th, 2013 by Ish No comments »

I was replying to some posts on the openSUSE group on Facebook when Sajoscha Ruiz tipped about the tools in Kali Linux. He was asking if it was possible to have all those tools bundled in some way and be installable straightaway in openSUSE.

That’s when the evil genius came in me (:

evil-genius-racoon

I thought of coupling this idea with my scripting projects. So, I went on the page he referred and made a list of the tools present in Kali Linux. As of now I have been able to bundle a dozen of those tools in openSUSE. Once I have enough of them … I’ll make the package available for download.

To make things more interesting I’ve called this Project Evil Genius version 1 – in short PEGv1.

Geany – a lightweight IDE

May 15th, 2013 by Ish No comments »

Geany is a lightweight text-editor that incorporates IDE features.

I came across Geany some time back when I had to edit scripts and test them quickly. I wanted something that could offer syntaxing, indentation, etc. My search lead to Geany.

geany-resize2

Geany supports auto-indentation, auto-complete, syntax highlighting among other features. These come handy when I work with Python/Perl scripts.

Download from : Project homepage
Geany is available from openSUSE repos :

# zypper in geany

Previously I used to split my terminals and edit on one using Vim and use the other to execute the script. It’s a cool way in the absence of IDEs though.

openSUSE Sticker

May 13th, 2013 by Ish No comments »

They do make my laptop look great (:

openSUSE-sticker

openSUSE ones I still have some. Will bring them in the next event.

netcat – swiss army knife for TCP/IP

May 13th, 2013 by Ish No comments »

They say it’s the “swiss army knife for TCP/IP”. They say it right!

I’ve seen netcat or we should simply say nc, in action a lot many times. When you can’t move files through the traditional SSH or FTP for “various” reasons, nc comes as a great savior.

It’s easy to create a socket server listening on one port.

$ nc -l 17000

The above command will start a server listening on port 17000. Let’s imagine the server’s ip address being 192.168.0.10. To connect to the server we have to do :

$ nc 192.168.0.10 17000

A server-client connection will be established and anything we type will be visible on both consoles. We can take things further and use netcat to transfer files. This time we start the server in receiving mode :

$ nc -l 17000 > openSUSE-12.3.iso

Yeah … I couldn’t take any other file as example (:
To send the iso file from the other end we do :

$ cat openSUSE-12.3.iso | nc 192.168.0.10 17000

You can combine several utilities together and the most done using netcat.

Linux Kernel 3.9.1 for openSUSE

May 12th, 2013 by Ish No comments »

Linux Kernel 3.9.1 is available from software.opensuse.org. For easy installation use the 1-Click-Install button.

kernel-3.9.1

Yet, by the time I was editing this post I noticed Linux Kernel version 3.9.2 was out. Check the Linux Kernel Archives. For Kernel compilation instruction you may follow this post > http://hacklog.in/compile-and-install-linux-kernel-3-9/.

Bash – for loop

May 12th, 2013 by Ish No comments »

Say you have some PHP files and you need to replace the .php extension with .html. The “for” loop in bash comes handy to do this task. However, prior to renaming we need to strip the .php extension from the file name and here awk does a great job. See a on-liner action :

$ for file in `ls | awk -F"." {'print $1'}`;do mv $file.php $file.html;done

I remember a colleague once asked me something similar and I used the “for” loop to add the .html extension. That time I didn’t strip the previous extension and the file names ended as .php.html which doesn’t look quite nice.

Perl – read file

May 12th, 2013 by Ish No comments »

It’s Sunday morning and there can’t be anything better than coding to brighten the mood!
Let’s get started …

While learning some Perl scripting the first things that I grabbed was reading & writing to files since that’s what I’d need most of the time. To show this let’s write a short script that will read a file and do some actions.

perl_read_file2

We use this script as follows :

$ ./read_file.pl file_to_read.txt

What does the script do?

The script opens a file handler that imports the content of the file into an array. The file handler is then closed. The number of items in the array is then counted and printed. That way we get the number of lines in the provided file.

xargs | command-line arguments

May 11th, 2013 by Ish No comments »

xargs is a nice utility that works in conjunction with pipes to construct argument lists and pass the same to other utilities.

Here’s how I’d search and remove all HTML files :

$ find . -name “*.html” -print | xargs rm -f

MariaDB migration

May 11th, 2013 by Ish No comments »

MariadbI was first tipped on the MariaDB project by Ronny (my ex-manager). At that time to my surprise he even announced my name in the LUG mail list to do a MariaDB presentation. In short notice I had to research and prepare a couple of slides. So, that’s how it all started with MariaDB. I contacted Colin Charles from the Monty Program and grabbed as much information as I could. He also gave me some presentation slides.

hacklog.in today is proudly running on MariaDB :)

When saying that MariaDB is a drop-in replacement of MySQL, it’s true! If you have an existing MySQL instance, you just have to remove mysql-server and install mariadb-server. There is no need to dump & restore databases since the binary files remain compatible with MariaDB. You may however do your regular database backup prior to the migration.