Trylinux.org
 

February 6, 2008

Dumping a mysql table to SQL

Filed under: General, linux, reminder, tips — tip @ 1:52 pm

I usually use phpMyAdmin to dump my table to SQL, but sometimes it is easier to do it from the command line. Use the following syntax to dump a table to SQL.

mysqldump -p -e -c --add-drop-table -r table.sql dbname table

Warning: The –add-drop-table will cause it to drop the existing table when you import.

You can import this with the command

mysql -p dbname < table.sql

January 21, 2008

Btrfs

Filed under: General, linux — tip @ 8:08 pm

Looks like this filesystem has some promise, hope it matures quickly.

http://oss.oracle.com/projects/btrfs/

December 14, 2007

yum repository from Dell

Filed under: General, linux, tips — tip @ 1:53 pm

I was thinking to myself it would be really great if Dell made available a yum repository for open manage. So I did a search and sure enough the do! This makes my job a lot easier :)

http://linux.dell.com/repo/hardware/

Also check out http://linux.dell.com/wiki/index.php/Repository/software
and http://linux.dell.com/wiki/index.php/Repository/firmware

vsftpd 426 “Failure writing network stream”

Filed under: General, linux — tip @ 12:17 pm

I was getting errors when trying to download a file from a mounted windows share with vsftpd.  The fix for this problem is to add use_sendfile=NO to your vsftpd.conf file.

December 12, 2007

yum upgrades tip

Filed under: General, linux, tips — tip @ 10:37 pm

When upgrading with yum I have started taking an rpm inventory before and after the upgrade.
Before Upgrade:

rpm -qa > BeforeUpgrade.txt

After Upgrade:

rpm -qa > AfterUpgrade.txt

Then I can compare them so that I know which packages were not upgraded and I can figure out why the did not upgrade.

cat BeforeUpgrade.txt AfterUpgrade.txt | sort | uniq -c | sort -n | grep "^\ *2"

yum Could not find any working storages

Filed under: linux — tip @ 10:07 pm

I upgraded a server from CentOS 4 to CentOS 5 via yum and kept getting “Could not find any working storages.” I searched the web and found some other people having the same problem, but I didn’t see any solutions. After some fun with strace, I found that it was looking for /usr/lib/python2.4/site-packages/sqlite which wasn’t there. It turns out that the package name for python-sqlite did not change between CentOS4 and CentOS5 so the package was not upgraded. I suggest that if you have this problem you look at all the files in /usr/lib/python2.3/ and find out what packages they belong to with “rpm -qf” and upgrade them manually. You can upgrade python-sqlite with the following command (The version number may change).

rpm -Uvh --force http://mirror.centos.org/centos/5.1/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm

October 27, 2007

Problems with pyTivo ffmpeg and ac3

Filed under: linux, tivo — tip @ 11:57 pm

I kept getting errors when trying to use pyTivo to stream shows to my Tivo HD.
Unsupported codec (id=86020) for input stream #0.0

After researching this it seems that this is due to lack of ac3 support in ffmpeg. After examaning ffmpeg it looked like it was compiled correctly, but it still would not work. I uninstalled the rpm and compiled it manually. This made things worse, the shows did not even show up on the Tivo for tranfser. Finally I realized that a52dec and ffmpeg were installed from different repositories. The packages from the livna repository work, but packages from atrpms do not work. So in order to fix this, remove ffmpeg and transcode and all their dependancies with rpm -e. Then install ffmpeg and transcode with yum while disabling the atrpms repository.

yum --disablerepo=atrpms install ffmpeg transcode

Now if I could just increase the transfer speed.

P.S. I’m working on a python script that will download, decode and play shows from the tivo all at once, so shows play instantly.

October 22, 2007

Reboot a windows box from Linux

Filed under: linux, tips — tip @ 11:59 am

Occasionally I have the need to reboot a windows box from Linux. Here is the command I use to do this.
net -I {IP Address} -U Administrator rpc shutdown -r -f

The net command is part of the samba package and can be used for much more than rebooting, like adding or deleteing users, etc.  Read the man file for more info.

October 18, 2007

convert is awesome

Filed under: linux, tips, tools — tip @ 9:17 pm

Someone was asking how to convert PDFs to JPGs and I thought to myself, surely there is a Linux utility to do this. Well ImageMagick comes with a utility called convert and the syntax is really easy.

convert test.pdf test.jpg

This will create a jpeg for each page of the pdf.  Simple right?  Plus it supports many input and output formats.

October 5, 2007

Accessing MSSQL from PHP on Linux

Filed under: linux, php, tips — tip @ 3:33 pm

Need to access a MSSQL database from php on Linux? The remi repository has php-mssql and all the dependencies.  Look for the yum configuration link on the home page.  Very easy.

http://remi.collet.free.fr/

They also have a link to an IT asset management program called GPLI, I haven’t used it but the demo looks pretty nice.  The functionality seems to be there, but interface could use a little polishing, IMHO.

« Previous PageNext Page »