Wednesday, July 27, 2011

Empathy logs in Ubuntu

Empathy logs your conversation by default and it seems to store its log in different locations between different releases? on ubuntuforum thread people found it under:
~/.gnome2/Empathy/logs
~/.local/share/Empathy/logs
~/.local/share/empathy


On my Ubuntu 10.10 I found them here:

~/.local/share/TpLogger/logs

Friday, July 8, 2011

Ubuntu 10.10 on Acer AspireOne 522

quite a few issues with Ubuntu 10.10 on AOD522


Problem #1 - it keeps hanging after login:
disable the atl1c driver and update the initramfs image:
add in /etc/modprobe.d/blacklist.conf this line
blacklist atl1c
update-initramfs -u



Problem #2 - getting AMD video driver to work:
sh ati-driver-installer-11-6-x86.x86_64.run --buildpkg Ubuntu/maverick
apt-get install -y debhelper dh-modaliases libqtgui4 execstack
sh ati-driver-installer-11-6-x86.x86_64.run --buildpkg Ubuntu/lucid
aticonfig --initial
aticonfig --resolution=0,1280x720

Problem #3 - speaker doesn't turn off after headset plugged in:
apt-get install pavucontrol
/etc/modprobe.d/options.conf
options snd-hda-intel model=laptop,dell-vostro position_fix=0,1

If you don't like the new interface with mutter, you can get the old netbook-launcher back:
apt-get install netbook-launcher-efl





Tuesday, July 5, 2011

USVN with Active Directory

to make USVN's LDAP working with Active Directory was tricky, use the following in config.ini

alwaysUseDatabaseForLogin = "admin"
authAdapterMethod = "ldap"
ldap.options.host = "domain.com"
ldap.options.port = "389"
ldap.options.username = "CN=username,CN=users,DC=domain,DC=com"
ldap.options.password = "password"
ldap.options.useStartTls = "0"
ldap.options.useSsl = "0"
ldap.options.bindDnFormat = "%s"
ldap.options.bindRequiresDn = "1"
ldap.options.baseDn = "DC=domain,DC=com"
ldap.options.accountCanonicalForm = "0"
ldap.options.allowEmptyPassword = "0"
ldap.options.optReferrals = "0"
ldap.options.accountDomainName = ""
ldap.options.accountDomainNameShort = ""
ldap.options.accountFilterFormat = "(&(objectClass=user)(sAMAccountName=%s))"
ldap.createGroupForUserInDB = "1"
ldap.createUserInDBOnLogin = "1"

Thursday, April 7, 2011

JIRA instance restarter

Just a simple script I use to watch for JIRA process, in case if it dies the script would restart it automatically.  This can be used for whatever process.  Note: it's using ps awwx under Solaris.

#!/bin/sh


jira=$1

pid=`/usr/ucb/ps awwx | grep java | grep "$jira"  | awk {'print $1'}`

if [ "$pid" = "" ]
then
    pid=0
fi
if [ $pid -gt 1 ]

then
    echo $jira" - JIRA is running fine"
else
    echo $jira" - JIRA is not running, trying to restart... "
    echo $jira"bin/restart.sh"
    $jira"bin/restart.sh"
fi


----------------------------------------------------------------
few more JIRA house keeping daily scripts:


## lock-cleanup.sh

#!/bin/sh
JIRA_HOME=/opt/global/jira
if [ -f $JIRA_HOME/index/comments/write.lock ];
then
    rm $JIRA_HOME/index/comments/write.lock
fi
if [ -f $JIRA_HOME/index/issues/write.lock ];
then
    rm $JIRA_HOME/index/issues/write.lock
fi


----------------------------------------------------------------
## backup-cleanup.sh 
#!/bin/sh
JIRA_HOME=/opt/global/jira
DAYS=30
find $JIRA_HOME/backup/ -name "*.zip" -ctime +$DAYS -exec rm {} \;

Friday, April 1, 2011

concrete5 add-ons install in FreeBSD

concrete5.org provides lots cool add-ons that can be installed by GUI in your concrete5 site.  The add-on is a archive zip file where it needs to be unzipped to your concrete5 web directory on the server.  If you try to install it by GUI with one click and your backend is running on FreeBSD, you going to see an install failed message without further details.  The root cause is that concrete5 hardcoded the path of unzip under /usr/bin/unzip

fix:
install unzip from FreeBSD ports, it will be located in /usr/loca/bin/unzip
cd /usr/ports/archivers/unzip
make ; make install ; make clean

make a symbolic link to it:
cd /usr/bin/
ln -s /usr/local/bin/unzip unzip

now you are done, enjoy one click install!

Tuesday, March 22, 2011

converting decimals to binary & hex

Trying to keep brain from getting rusty... coded some simple functions in C that takes a decimal and spits out binary and hex.  Thought I might share it, enjoy!



#include
#include

void dec2bin(int dec);
void dec2hex(int dec);

int main(char *argv[])
{
    int i,j,num,tmp;

    scanf("%d",&num);
    printf("dec: %d\n",num);
    printf("bin: ");
    dec2bin(num);
    printf("\nhex: ");
    dec2hex(num);
}

void dec2bin(int dec)
{
    if (dec>0)
    {
        dec2bin(dec>>1);
        if (dec&1>=1)
            printf("1");
        else
            printf("0");
    }
}

void dec2hex(int dec)
{
    if (dec>0)
    {
        if (dec<10)
            printf("%d",dec);
        else if (dec>15)
        {
            dec2hex(dec/16);
            dec2hex(dec%16);
        }
        else
            printf("%c",dec-10+'A');
    }
    else
        printf("0");
}

Monday, March 7, 2011

using ipod shuffle under linux

I've been using gtkpod with my ipod shuffle.  A while ago, not sure what I have done when loading new songs into it, seems everything is corrupted, in gtkpod and hipo both shows the old songs, but when I play it there were only a few new songs available on the device and old ones were not in there.  Tried both gtkpod and hipo to delete the songs to start from fresh but had no luck.  At the end, command line tools does th trick, install gnupod-tools

gnupod_INIT -m /media/IPOD
gnucheck_--fixit -m /media/IPOD