Zagura’s blog

November 12, 2008

Word generator

Filed under: English, Fun, Linux, Programming — puthre @ 5:47 pm

Here is a python script to generate words using Markov chains. The archive also contains some dictionaries (English, Romanian, Romanian names). This is similar with http://www.fourteenminutes.com/fun/words/ but you have the possibility to use your own word dictionaries.

February 7, 2008

Publish your ssh public key on remote sites made easy

Filed under: Linux — puthre @ 11:54 am

Here is a script to easy publish your ssh2 public key to the remote sites you frequently connect to.

Example:
sshpubkey.sh user@example.com

You will now be able to connect to example.com from your machine without entering the password.

January 9, 2008

Midnight Commander Color Themes

Filed under: Linux — puthre @ 3:58 pm

Here is a script to easy change the default blue scheme of Midnight Commander.

Unpack the archive and do:

./mc_change_theme.sh puthre.theme

To revert to the default scheme just:

./mc_change_theme.sh default.theme

The script will modify your ~/.mc/ini file. Please make sure that Midnight Commander is not running when you change your theme.

Here is how a theme file looks:
BASE_COLOR=lightgray,blue
NORMAL=lightgray,blue
SELECTED=black,cyan
MARKED=yellow,blue
MARKSELECT=yellow,cyan
ERRORS=white,red
MENU=white,cyan
REVERSE=black,lightgray
DNORMAL=black,lightgray
DFOCUS=black,cyan
DHOTNORMAL=blue,lightgray
DHOTFOCUS=blue,cyan
VIEWUNDERLINE=brightred,blue
MENUHOT=yellow,cyan
MENUSEL=white,black
MENUHOTSEL=yellow,black
HELPNORMAL=black,lightgray
HELPITALIC=red,lightgray
HELPBOLD=blue,lightgray
HELPLINK=black,cyan
HELPSLINK=yellow,blue
GAUGE=white,black
INPUT=black,cyan
DIRECTORY=white,blue
EXECUTABLE=brightgreen,blue
LINK=lightgray,blue
STALELINK=brightred,blue
DEVICE=brightmagenta,blue
CORE=red,blue
SPECIAL=black,blue
EDITNORMAL=lightgray,blue
EDITBOLD=yellow,blue
EDITMARKED=black,cyan
ERRDHOTNORMAL=yellow,red
ERRDHOTFOCUS=yellow,lightgray

Here is the result:
mc.png

July 10, 2007

Problems emerging device-mapper.1.02.19 with confcache on Gentoo

Filed under: English, Linux — puthre @ 3:10 pm

Disable confcache in /etc/make.conf if you are getting this when trying to emerge device-mapper.1.02.19 on Gentoo:
checking target system type… config.sub: missing argument
Try `config.sub –help’ for more information.
configure: error: /bin/sh autoconf/config.sub failed

!!! Please attach the following file when filing a report to bugs.gentoo.org:
!!! /var/tmp/portage/sys-fs/device-mapper-1.02.19/work/device-mapper.1.02.19/config.log

!!! ERROR: sys-fs/device-mapper-1.02.19 failed.
Call stack:
ebuild.sh, line 1621: Called dyn_compile
ebuild.sh, line 973: Called qa_call ’src_compile’
ebuild.sh, line 44: Called src_compile
device-mapper-1.02.19.ebuild, line 22: Called econf ‘–sbindir=/sbin’ ‘–disable-selinux’
ebuild.sh, line 578: Called die

!!! econf failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at ‘/var/tmp/portage/sys-fs/device-mapper-1.02.19/temp/build.log’.

April 26, 2007

Kernel 2.6.21 is out

Filed under: English, Linux — puthre @ 11:44 am

Kernel 2.6.21 is out ant it contains my Logitech Formula Force EX force feedback patch

March 13, 2007

CentOS _dl_sysinfo_int80 deadlock

Filed under: English, Linux, Programming — puthre @ 12:17 pm

Are you using a CentOS or CentOS derived distribution and you experience deadlocks in dl_sysinfo_int80 function like this?:

#0 0×00ace7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0×00cb248b in __read_nocancel () from /lib/tls/libpthread.so.0
#2 0×080bdf39 in el_push ()
#3 0×080bdfda in el_getc ()
#4 0×080bde50 in el_push ()
#5 0×080be11b in el_gets ()
#6 0×080a6f59 in main ()

Then you need to upgrade the kernel to the lastest version from the CentOS repositories (2.6.9-42.0.10.EL as of today):

yum upgrade kernel

Have Fun!

March 10, 2007

Using libGD to manipulate jpeg images in C

Filed under: English, Graphics, Linux, Programming — puthre @ 12:53 am

Yesterday, for a small project of mine, I needed to implement a small utility to deform jpeg images from command line. The idea was to use texture mapping for deformations, so I needed a way to manipulate the jpeg images at the pixel level.

The first thing I tried was the imagemagik utility. I’ve browsed their documentation but I couldn’t find anything close to what I needed. I wanted to be able to draw textured mapped triangles into a picture. I knew that the Allegro library that I’ve used back in the old DOS programming days could do the texturing part. The bad thing that I found out is that it does not know how to handle jpeg files :(

Then I googled the Internet for a free and easy to use graphic library and I found libGD. The good thing is that it can handle jpeg files. The bad thing is that it cannot do the texturing part. The next thing I had in mind was to use both libraries but this would mean to add lots of dependencies to my small application for a simple texture mapping function. So I decided to write my own texture mapping function to remember the good old days. I will not describe how texture mapping works as there are plenty of tutorials on the internet for this.
(more…)

February 19, 2007

Running X applications under chroot jail

Filed under: English, Linux — puthre @ 9:52 pm

Having a Gentoo32 chroot as a fallback on a Gentoo64 system is not unusual. Some things simply do not work on Gentoo 64 (as FlashPlayer 9) or you need a distcc server for the other (32 bit) systems.

I wrote a simple bash script that allows the X applications under chroot jail to connect to the XOrg server runing outside the jail.
You can find it here.

Example:

linux32 xchroot /mnt/gentoo32

firefox

I only tested it on Gentoo.

February 6, 2007

Every time you feed a troll, God kills a kitten

Filed under: English, Fun, Life, Linux — puthre @ 2:52 pm

Feed the troll

http://lists.lug.ro/lurker/message/20070205.152933.4a60c9ff.en.html

Sharp Zaurus Out of Production

Filed under: English, Linux, Zaurus — puthre @ 11:32 am

It seems that Sharp will no longer produce the Zaurus line.

Hi all,

yes, we have to confirm that Sharp pulled the plug out
of the Zaurus line.
No successor model is planned, and the end of production
will be early February.
For sure we’ll continue with support, service and accessories
for the Zauri. Also there’re interesting other products around,
so the fun with mobile Linux products is definitely not over.

///TRIsoft

Marc Stephan

http://www.oesf.org/forums/index.php?showtopic=22804&view=findpost&p=150920

« Previous PageNext Page »

Powered by WordPress