ryu's blog just a few lines of code

24Jan/120

HOWTO be classy

Open these three links in three tabs and listen simultaneously:

http://www.rainymood.com
http://youtu.be/DIx3aMRDUL4
http://youtu.be/HMnrl0tmd3k

Filed under: Uncategorized No Comments
13Oct/110

HOWTO Compile Objective-C in Ubuntu (11.04)

To compile Objective-C code in Ubutnu, just install gcc, gobjc, gnustep and clang.
The actual compile process for a file eg. called code.m starts with the following line:

# gcc -o code code.m -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lgnustep-base -fconstant-string-class=NSConstantString

But, in my case there was an error: 'error: #error The current setting for native-objc-exceptions does not match that of gnustep-base ... please correct this.'
To solve this problem, do the following:

# vim /usr/include/GNUstep/GNUstepBase/GSConfig.h

:set nu

Go to line number (in my case) 221, or search for:

#define BASE_NATIVE_OBJC_EXCEPTIONS 1

Replace the line with:

#define BASE_NATIVE_OBJC_EXCEPTIONS 0

Now the compiler should work without problems! :)

21Sep/110

HOWTO: Install PHP Memcache on Ubuntu

Update, install new software an restart Apache:

# apt-get update && apt-get upgrade

# apt-get install memcached php5-memcache

# /etc/init.d/apache2 restart

Now test it. Start a new memcache instance:

# memcached -u root -d -m 24 -l 127.0.0.1 -p 11211

This instance starts as root user using 24 MB as maximum cache size, listening on port 11211.
On my system, I have this process running now:

13919 ? Sl 0:00 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1

We can test our running memcache process by connecting via Telnet:

# telnet 127.0.0.1 11211

An overview of the availiable commands, you can find here: http://lzone.de/articles/memcached.htm
If you like to change your default memcached configuration, do the following:

# vim /etc/memcached.conf

Don't forget to restart memcached afterwards:

# /etc/init.d/memcached restart

At this point you would have to start all memcached instances manually. That's a thing I wouldn't like to worry about. So move the commands to rc.local:

# vim /etc/rc.local

Add lines like this before 'exit 0':

memcached -u your-user-name -d -m 16 -l 127.0.0.1 -p 11211

Make sure every instance listens on a different port. For example: 11211, 11212, 11213... etc.

28Aug/110

Debian: Change system language

# apt-get update

# apt-get install debconf

# dpkg-reconfigure locales

Tagged as: , No Comments
28Aug/110

FreeBSD: Enable root access via remote SSH

On FreeBSD you can't login via remote SSH as root user.

# adduser christoph

User christoph will be able to gain access via SSH just as every other user.

# pw usermod christoph -G wheel

By putting this user in de group wheel, the user gains the right to change to root via:

# su

Tagged as: No Comments
28Aug/110

FreeBSD: Reenter install tool

# sysinstall

Tagged as: No Comments
28Aug/110

FreeBSD: Set IP for an existing interface

Assume interface name is: em0

# vi /etc/rc.conf

hostname="shiva.local"
ifconfig_em0="inet 10.0.0.10 netmask 255.255.255.0"

# /etc/netstart

Tagged as: No Comments
16Jun/110

Fully functional Flash Player on Ubuntu (Firefox/Chrome)

Replace libflashplayer.so in /usr/lib/flashplugin-installer/ with the file you can download here:
http://labs.adobe.com/downloads/flashplayer10_square.html

Why? - For example youtube.com worked for me, but grooveshark.com or livestation.com didn't. - Now everything works fine!

6May/113

Skype logo missing on Gnome Panel in Ubuntu 11 with Classic Desktop

How so solve this problem? - Just do the following:

Press ALT+F2, and enter:

gconftool --recursive-unset /apps/panel

After the system being busy for a moment, press ALT+F1.
Your Skype icon should be visible again!

Tagged as: , , 3 Comments
3May/110

Facebook Like Button auf Deutsch stellen

Statt 'Like', 'Gefällt mir' anzeigen auf dem Facebook Button ist eigentlich ganz einfach.

Man verwendet statt der Vorgabe,

<script src="http://connect.facebook.net/en_US/all.js"></script>

folgende Javascript Datei:

<script src="http://connect.facebook.net/de_DE/all.js"></script>