RSS Mobile
 
tumblr:~ blog$ /usr/bin/alex --fortune

 


6 Dicembre, 2008
text

bash scripting - VGA toggle switch

VGA port, really useful way to display through big Monitor or TV your tiny videos instead of watching them on your little notebook’s display :-)

Are you bored to have to restart X every time you want to connect your VGA cable?

Don’t you want to use gnome-display-etc-etc-manager to only configure a stupid VGA Monitor?

Don’t worry, you can use a little bash script (linked to some buttons on you panels), to manage your VGA connection.

I works like a switch, the script will enable the output choiced if this is disabled and viceversa it will disable the output if this is enabled.

But stop speaking (/writing) and watch it now:

vga.sh:

#!/bin/bash
#
# This script was created to manage an external output for notebook
#    The script only needs a bit of configuration to set the default output, mode, rate and extra options,
#    It works like a switch, the script will enable the output choiced if this is disabled and viceversa it will disable
#        the output if this is enabled.
#    It can be used on various acpi script linking it to your notebook’s fn+key.
#
# Made by: Alessandro Arrichiello <alezzandro@gmail.com>
#
# Configuration starts here:

output=”VGA”
mode=”1024x768”
rate=”60”
extra_options=”—right-of LVDS”
xrandr_cmd=”xrandr —output “$output” —mode “$mode” —rate “$rate” “$extra_options

#
# END of Configuration

xrandr_output=`xrandr|grep $output`

if [ `echo $xrandr_output|grep -c disconnected` == “1” ]; then
echo “Cable for “$output” not connected.”
else
if [ `echo $xrandr_output|grep -c connected` == “1” ]; then
if [ `echo $xrandr_output|grep -c $mode` == “1” ]; then
echo “Putting off: “$output
xrandr —output $output —off
else
echo “Putting on: “$output
`$xrandr_cmd`
fi

else
echo “Output not found check your configuration.”

fi
fi

Remember to set the right permissions (chmod +x vga.sh),

see you,

4 Dicembre, 2008
photo

Couldn&#8217;t execute command: evolution Verify that this is a valid command.

This is what you can see if you&#8217;ve removed evolution from your ubuntu distro and it will appear every time you&#8217;ve plugged in the AC of your notebook.
You can simply avoid this problem by remove execute permission to the script file responsable of this action:


root@dothan:/# chmod -x /etc/acpi/mailbtn.sh


If you have evolution installed, you can also do this command to avoid to launch it every time you will plug AC on your notebook.
gbye,

Couldn’t execute command: evolution
Verify that this is a valid command.


This is what you can see if you’ve removed evolution from your ubuntu distro and it will appear every time you’ve plugged in the AC of your notebook.

You can simply avoid this problem by remove execute permission to the script file responsable of this action:

root@dothan:/# chmod -x /etc/acpi/mailbtn.sh


If you have evolution installed, you can also do this command to avoid to launch it every time you will plug AC on your notebook.

gbye,

26 Giugno, 2008
text

Picasa Badge

I’m happy to announce that after many days of debugging and testing,

I’ve published Picasa Badge! (as you can see on the right bar) ->

Dependencies: LWP::Simple perl module (namely also: perl-libwww)

NOTE: Picasa is a registered trademark of Google Inc. Picasa Badge is not a partner, affiliate, or licensee of Google Inc., nor is it in any other way formally associated with Google Inc.

Use this software at your own RISK!
The author declines every responsability about this software.

Picasa Badge is a perl script that lets you display on your website a badge containing picasa random photos or albums.
You can edit many settings and the style of your badge (it will be displayed on a <div id=”picasabadge”> </div> element that you can edit with you css style).

Usage:
Example:
Include in your webpage the script by this way:
<script type=”text/javascript” src=”http://your.host.name/cgi-bin/picasabadge.pl?account=YOUR_ACCOUNT_NAME&kind=photo&thumbsize=72&max-results=4&total-photos=275&vertical=1&display-logo=1“></script>
As you can see, you can set various options,
Allowed options are:
* account = “Your Account Name
* kind = kind of display objects: “photo” or “album
* thumbsize = the site of thumbnails: 32, 48, 64, 72, 144, 160
* max-results = how many photos picasa badge have to display.
* total-items =  total photos stored on your album or total albums (You can obtain it on picasa account or reading the rss code of your account)
* vertical or horizontal = set it to “1” to see picasa badge vertical or horizontal
* display-logo = set it to “1” to see Picasa Badge logo on your badge



NOTE: I’ve added a little security fix to avoid overloading of my webserver: I’ve added my account name directly into source file to avoid that anyone could use it from my webserver, you can feel free to remove/edit it when you have downloaded the source file!

You can find always the latest version of picasa badge at:

http://code.alexworld.it

or directly here: http://code.alexworld.it/code/picasabadge.pl.html

Feel free to contact me for every problem!

bye,

18 Giugno, 2008
text

torrentmanager on code.alexworld.it

Today I’ve published a little but powerful SH script to manage torrent files with enhanced-ctorrent (already known as: ctorrent).

You can find it on: http://code.alexworld.it

or directly here: http://code.alexworld.it/code/torrentmanager.sh.html

Have a nice day!

Alessandro.

1 Giugno, 2008
text

First preview of CodeManager

Yesterday I’ve published a first snapshot of my little project: CodeManager,

It’s a perl script that manage various type of source codes, it can highlight, publish static html and pack original source code file,

You can insert source code by file or directly by html form, It also manage an index.html file that you can edit with your own favourite style in which it display all the last uploaded source files ordered by date.

You can see a first preview of the static html produced on:

http://code.alexworld.it

It’s very incomplete so I decided to not publish the source code yet,

Stay tuned for news! :-)

HomeWebsite Homepage RSSTake the RSS! ArchiveLook at Blog Archives
MailMeSend me an eMail MailgpgTake my gpg key
Skype
Add me to Your Skype Account
ChatChat with Me! WorksLook my Works FlickLook my Picasa Photo Album!
YoutubeLook my Videos on Youtube! del.icio.usLook my bookmarks on del.icio.us! TechnoratiAdd to Technorati Favorites!
VimeoHDMy HD Videos on Vimeo! GoogleGo to Google! MTV-nomafieGo to MTV nomafie!


Visualizza il profilo di Alessandro Arrichiello su LinkedIn