viernes, 23 de abril de 2010

Disable Poweroff when lid is closed in Xandros Presto!

1) Press alt+f2
2) Run nothing (empty text box) with the "Run in Terminal" box
3) type in this:
sudo chmod -x /etc/acpi/lidbtn.sh


This will make the script that executes when the lid button is pressed unexecutable, thus not turning your computer off when you close the lid

Disable Trial Limit in Xandros Presto!

In this tutorial i will teach you how to disable the trial limit in Xandros Presto!

1) Boot up your Xandros Presto! It must be one that still has trial period remaining (You can change the BIOS date to fool it)
2) Press Alt+F2 and click the Run In Terminal, and click Run (the textbox must be empty)
3) Now you have a working Terminal window, type in this:
sudo chmod -x /opt/xandros/bin/PrestoLicenseManager


Now your License Manager will be un-executable, and wont run anymore and block the rest of your OS.

martes, 20 de abril de 2010

OSX server, Wiki and Active Directory

I had a lot of issues enabling a wiki service with a OSX server in a Active Directory enviroment.
Given the case you have an Active Directory with all the authentications (users, groups, etc) and you want to implement a OSX wiki server, It wont be an easy feat.

This is what I did:

1) I began with a clean install of the OSX Server, and configured it to be a Open Directory Master.
2) Then, I binded the OSX with the Active Directory, and added the AD to the search and auth. policy
3) With the WorkGroup Manager, in OSX, I created a workgroup with the users I want to allow to use the wiki, and gave it permission to use the Wiki resource.
4) Using the Workgroup's MemberList, I clicked on the + simbol, selected Active Directory from the little globe icon over the list, and drag and dropped the users from the AD I wanted to have wiki access
5) Saved and closed the WorkGroup Manager, opened the Server Admin.
6) Added iCal and Web services to the list, then turned iCal on (should get up automatically) and turned on the Wiki service on the web, then started the web.
7) Then you must follow this procedure: Apple Support TS1619
8) Wait a minute or two, then access your webpage using the domain you gave the web page (Will give 404 error when trying to access the wiki group if you don't) and you should be able to authenticate using the Active Directory users you added to the workgroup

lunes, 15 de marzo de 2010

Bash Script for Muting front Speaker

The following script will evaluate your "Speaker" audio output and change it to 0% or 100%, without modifying any other output.
This can be used to play audio from your speakers and your headphone output at the same time, or to roughly work-around the issue affecting some laptops where the speaker doesnt mute when a headphone is plugged (AKA jacksens not working)
It requires Alsamixer

export i=`amixer sget Speaker | grep 'Front Left:' | cut -d'%' -f1 | rev | cut -d'[' -f1`
if [ $i -eq 0 ]
then
amixer sset Speaker 100
else
amixer sset Speaker 0
fi

The script works by getting the amixer output for "Speaker" (you might need to change that); chopping it untill only a value is remaining (hence the cut | rev | cut); evaluating the output and then setting the volume to 100% or 0%

If this does not work you might need to change the Speaker output for some other, you can find your output's names by entering
amixer

in the terminal, and then changing any occurence of Speaker for your desired output's name.

miércoles, 10 de marzo de 2010

Switch between window managers

The following script will allow you to switch between Compiz and xfwm4 (xfce window manager):

#!/bin/sh
SERVICE='compiz'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
xfwm4 --replace
else
compiz --replace
fi


If you want to adapt this script to suit your needs, SERVICE= is the name of the process that will be tested if its running.
'then' is the action that will be done if the process is runing (in this case, launch xfwm4 with --replace argument for taking over compiz)
'else' is the action that will be done if the process is NOT running (in this case, launch compiz with --replace argument for taking over wfmw4

Load an entire webcomic (or part of it) at once

This will require Firefox and FlashGot.

Certain webcomics like www.sinfest.net store their images in a restricted folder, therefore we cant access them directly.
However, I noticed the images follow a naming pattern, which means a Regular Expresion should be able to find all the possible matches.
This is what i did:
1) Navigate to your webcomic, right click the strip, and click on "View image", take note on the files name and path (in this case, http://www.sinfest.net/comikaze/comics/2010-03-10.gif)
2) Navigate to the previous strip, and click on "View image" once more, take note on the name
(in this case, 2010-03-09.gif)
3) Now we need to identify a pattern, in this case, we can note the images are named [year]-[month]-[day].gif
4) Navigate to the first strip of the webcomic, so we can know from where to start.
5) Click on Tools, FlashGot, Build Gallery
6) Fill in the following:
In the first line, puth the entire path to an image, then change the year to [YearOfFirstStrip-YearOfLastStrip] (in this case: [2000-2010]). Do the same for month and days, in the end it should look like this: http://www.sinfest.net/comikaze/comics/[2000-2010]-[01-12]-[01-31].gif
7) Click on the arrow pointing downards, and change the file extension to .gif again
8) Wait for it to load and enjoy

-It is advised to load a few or one year at a time.
-Some images will never load because they simply don't exist, for example 2004-02-31.gif will never load because February will never have a 31th day.
-If you want to store the images into your hard drive, save the page as Web Page (Complete).

Automatically store music loaded into cache

The following script will allow you to automatically move music files from the firefox cache to any directory.
This should be in a single line, and you must edit both the [random folder name] and desired path/to/target to fit your needs:
file --mime-type home/[your username]/.mozilla/firefoz/[random folder name]/Cache/* | grep -i audio | cut -d':' -f1 | xargs -I{} mv {} /path/to/target/


It will identify Audio files regardless their extension (if present) and move them to the directory you specify in the end.

Depending on the page you are using, your cache may or may not be automatically deleted when the audio file is no longer needed. You can avoid that by using Proxomitron, which runs perfectly under Wine. Just install it, load it, and point your firefox to use proxy localhost, port 8080.

One last thing you might want is to point your preferred audio player to automatically scan your target directory, since the files wont have a descriptive name.