Linux: SCIM on Slackware64 (it is Salix64, anyway)

As I am going to learn different cultures with different charsets, I am going to need trustworthy input method for different for different charsets: Latin (English), Arabic, Japanese (Hiragana, Katakana and Kanji). I'll explain certain things for each language later in another posts, I promise.

There are various input methods available for Linux, yet I'll just stick with Slackware's good old default: SCIM. SCIM is official package in Slackware64. So installing the packages is pretty classic.

#installpkg ./slackware64/x/scim*.txz

Also make sure you are using UTF8-capable locale. Check /etc/profile.d/lang.sh for something like this:
export LANG=en_US.utf8

Enable SCIM script(s) in /etc/profile.d/ too
chmod +x /etc/profile.d/scim*
--anyway, is the anyone out there using csh in their daily mortal life?

OKI COREFIDO C301dn on Linux

My lab has got some (network) printers from OKI for lab members to print their works. The model students can use are OKI COREFIDO C301dn. Most guys here running Windows 7 or 8 (just like anywhere else), and getting it running from my Slacktop (it's Salix 14.1) is some extra work.

A quick lookup at OpenPrinting redirects me to foo2hiperc, which provides PostScript-compatible hiperc driver wrapper (which I don't know what this hiperc thing is).

You just get to download the package from http://foo2zjs.rkkda.com/foo2zjs.tar.gz,
untar
$ make
$ getweb 301
# make install
add the printer from your cups manager using the PPD given by foo2hiperc.
--I am still running cups 1.5.4  

________
Also, a little cite here:
All important desktop applications (GTK/GNOME, Qt/KDE, LibreOffice/OpenOffice.org, Firefox, Thunderbird, ...) send print jobs in PDF and not in PostScript any more by default. In addition, a complete CUPS filter chain to process print jobs in PDF is available and used.
 wow!

A gift: a mouse

E-3LUE Fresco Pro (EMS 107)



Sean gave me this, a Japanese mouse (e-blue) which he bought in Indonesia, then I brought it back to Japan, lol.

Though nowadays, I use my cheapo wired mouse more often.

Anyway, thank you very much.

Synaptics TouchPad Toggle

My new work laptop (Dell Latitude 3540) doesn't toggle touchpad on/off via hardware level, the key combination (Fn+F3) is merely XF86TouchpadToggle which XFCE [still at the moment] doesn't know what to do with.

I made a simple synaptics-toggle script:
if [ -f /tmp/synaptics-touchpadoff ]
then
    synclient TouchPadOff=0;
    rm /tmp/synaptics-touchpadoff;
else
    synclient TouchPadOff=1;
    touch /tmp/synaptics-touchpadoff;
fi


and mapped the script to XFCE keyboard binding utility. 

Upon finding ArchLinux more elegant solution here, I had to admit I was a bit ashamed.


Bisexuality


Recently my dear sister asked me about my view on bisexuality. As an electrical (computer) engineer [graduate], I put a simple analogy between sexual intercourse and power line plug-socket contact. Pretty dumb idea, yet I still had to make my mind up before posting this blog post days later on.

Plug is male: masculine, protruding, dominant, extrusive, yang, first.
Socket is female: feminine, recessed, recessive, intrusive, yin, either zeroth or second.
Things are mostly mix-and-match from these two, with major affiliation to one and minor influence from another. This is the thing that many psychoanalysts use to describe with the term 'bisexuality', hence it's different from common bisexuality (pan-sexuality) you can look up on wiki.

Heterosexuality is simple, traditional and well-known working method of sexual fulfillment.
Homosexuality isn't necessarily stupid, unnatural, and forbidden [by law], but it's definitely fruitless, improper and unsafe in its nature.
    Bisexuality(heterosexuality AND homosexuality);
Bisexuality is when a subject is neither exclusively heterosexual nor homosexual.

Saikat Guha in Tripartite Analysis of Sexual gratification explained the components of sexual gratification: physiological components, aesthetic components, and erotic component. This should apply for any form of sexual activity.
  • Physiological component: biological functions of body related to sexual activity: hormones, reproduction, sexual organs, sensory stimulus.
  • Aesthetic component: attraction towards certain qualities (personal traits) of a subject: fetishes, fashion, and favor towards specifics of a subject which quantify to [physical] measurements.
  • Erotic component: care, affection, sympathy.
Thus every aspects of living being related to sexual activity will have its qualities associated (majorly) to either male or female, e.g. estrogen/testosterone, breast/biceps, motherly/fatherly love. Non-living things are associated with this sexes too (we call it genders), for example swords are mostly named with masculine names, e.g. Gladius and vessels are named with feminine names, e.g. Elizabeth.

So how about same-gender sexual interaction?


Heterosexual: It's Schuko plug plugged in to Euro socket, looks just normal although the combination isn't from the same type. Here's just-fine if not proper electrical contact.

 
Homosexual: Two Schuko plugs tied and clamped together with twisted single wires. This surely isn't a proper way to use your electrical appliances, still there's electrical contact made.

If different-genders interaction is called contact, I'll call same-sex interaction either crash, clash, or something just isn't quite right here.

Bisexuality (pan-sexuality) just isn't my thing.

EECCIS 2014

My alma mater (Electrical Eng., Brawijaya University) holds an seminar bi-annually on various subjects on electrical engineering: electrical power, electronics, telecommunication, control system, computer engineering. This year's EECCIS 2014 is the 7th time, and the first time it's held joint committee with Universiti Tun Hussein Onn.



In the plenary session of the seminar, I had a chance to ask Prof. Dato' Mohd. Noh Dalimin after his lecture on superconductor applications for environmental sustainability. The presentation material wasn't that far from 1st year Electrochemisty on superconducting material (no 3rd order integral on temperature gradient and such; thx, God), still he gave us many enlightening insights.

I asked him about the feasibility of implementing superconductors as power line infrastructure considering that cryogenic cooling system is dire expensive; let alone that heat from the sunlight is enormous all year long in tropical countries. His answer was simple:
as the system deemed cost-ineffective at the moment, it means that there is a lot of room for improvement. And making those improvements that later yield tremendous benefit will surely cost huge amount of [sacrifices/]resources, too.

It gets me so damn hard.

___________

thank you so much for the pen case , it's made from recycled paper (the pen too); reminds us to be environmentally friendly.

Oldie Beauty

I've been riding with this utility bike for quite some time. She is an old bike (from late 80s or early 90s, I suppose) which I already broke the fork she came initially with. The original paint is purple but already covered with black layer by the time I purchased her from local flea market.

About the group: the brake-shift levers are old Altus, the rear derailer is A050, front mech is Tourney. The wheel is Nova Rigida with local-made Delitire tire. The latest addition is messy bluish-black paintjob (which is a big mess done by me personally) and the invert-installed fork.

I had to install the fork inverted because I messed welding the headtube (the original one simply tore away), putting it way too reclined. Given the stem is already too short, the handling is hard and nippy, thus to compensate this problem I had to invert the fork so the front axle is closer way back.


 
simple black beauty

Retirees

I've finally retired my faithful KMC Z9 and 3 sprockets (2300's 15T and 13T, Deore's 11T). All of them have gone through considerable abuse (by me personally). May peace be upon them.

The chain: KMC Z9, beaten up pretty good













The chain is elongated way too much. It makes squeaky noise under heavy pedal stroke. Not that I am a powerful pusher-sprinter, I just forgot to replace it sooner (it's been around for 2-3 years already if I remember correctly).

Let's get technical: 15.5 links are 20 cm long (the tile is 20 cm wide). The math is: 15.5 links x 1.57 cm (standard chain pitch) = 19.685 cm is the way a good chain should be. So how abused my chain has gone through? 20 cm / 15.5 links = 1.29... cm/link; 1.29 x 20 cm = 25.8... cm. Sheldon here said that it is way over the tolarable length (25.7 cm for 20 links--10 links if you count inside-outside links as a link).

I guess I am pretty stupid not to change it sooner.

top 3 sprockets













I rode all-odd 8-speed 25T-11T, and the top (smallest) three are my favorites. On commuting rides, I mostly went with 50/34 at front 13T at the rear, occasionally switching to 15T or 11T for extra acceleration or extra 'push' rescpectively. To make things worse: I'd like to do some climbing on 34T compact front and 15T in the rear. Yeah, you may call me pussy now.

The sprockets are probably heavily dammaged by the over-elongated chain. As I replaced the chain (with another KMC Z9 of course), it frequently 'skipped/jumped' if I am on 34 in the front. So I need to change these sprockets too. Now I am riding 26T-23T-21T-19T-17T-15T-13T-12T. Yeah, you may call me pussy again now.

The moral is: always inspect your chain regularly, 2 weeks or so will do.

---update
Forgot to include my loose bottom bracket's bearings too (Sora's Hollowtech II)
the left bearing is super-loose, the right is so-so

Nervousness-induced Stupidity

Last Friday (6/27) I had an interview for my entrance exam for a scholarship program over Skype. And I kind of failed it, quite miserably I have to admit. The pace of the interview was so nervous-inducingly fast.
  • I forgot my registration number for the test,
  • I forgot what RISC stands for, it's reduced instruction-set computer anyway,
  • I couldn't even said that RISC uses fewer clock cycle(s) per instruction compared to "de facto" standard of x86 processor architecture family which belongs to CISC architecture: complex instruction-set computer,
  • I couldn't clearly explain my internship experience (which could be strong point in the interview)--even I mention the organization's name wrong in English,
  • I showed how little my experience with FPGA by saying the furthest I had gone with it is merely dumb stopwatch, 
  • I showed how lame my experience in programming in assembler language,
  • I spoke gibberish thing like: I love being in a team, which has no real implication IRL,
  • I brought up non-technical issues on something in which we hope such issue won't happen related to its technical implementation,
  • I was pausing mid-sentence... over and over again,
  • I was sure my voice wasn't audibly illegible,
  • ... and all other silly mistakes I did unawarely
The only thing I was confident about is when I said "I'd definitely do".
...I was just panicking like stupid, definitely.

iptables: transition intrapositioned to extrapositioned negation

Just today when I was writing iptables rule for my lab's gateway which (sadly) still have to rely heavily on IPv4 NAT (network address translation), it spew something cute when I put such rule:

# iptables -t nat -A POSTROUTING -s 192.168.0.0/25 -d ! 192.168.0.0/24 -o br1 -j MASQUERADE
The rule tells iptables to masquarade packets originating from 192.168.0.0/25 which destination isn't within 192.168.0.0/24 (my lab has two gateways for each /25 subnet, fyi).

It said:
Using intrapositioned negation (`--option ! this`) is deprecated in favor of extrapositioned (`! --option this`).

The rule still worked just fine. But as a good guy, let's adhere to the current standard (which is assumed to be 'more correct' :D )
# iptables -t nat -A POSTROUTING -s 192.168.0.0/25 ! -d 192.168.0.0/24 -o br1 -j MASQUERADE

vsftp: anonymous can do 'em all

I need quick vsftpd config to allow anonymous user to anything on my ftp server, I wouldn't need security/auth this time.

anon_root=/home/liyan/ristie
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_world_readable_only=YES
anonymous_enable=YES
listen=YES
listen_port=21
local_enable=NO

write_enable=YES

Spring the daemon up and you're good to go.

Qt 4.8 is better than Qt 5.x

I am currently helping a friend doing project on Qt and OpenCV. There're some problem I encounter regarding library dependencies:

I can't build newer OpenCV (2.4.9) against  libavutil.so.52 (ffmpeg-2.1.4), therefore I resorted to Slackbuild's prebuilt OpenCV 2.4.5

I can't compile sanely valid Qt program OpenCV 2.4.5 on Qt 5.2. Which in turn becase OpenCV 2.4.5 is build around Qt 4 (4.8 most likely). I hate this dependency hell.

So here I am, reverting back to Qt 4.8. Good thing Slackware64-current's is Qt 4.8.2.

libsecret: udev getting pwn'd

My filemanager (pcmanfm) just stopped recognizing newly plugged-in USB flashdrives after I upgraded from Slackware64-14.0 to Slackware64-14.1 (it's actually Salix64 anyway). Running /usr/libexec/gvfs-udisks2-volume-monitor told me that libsecret is missing.

# installpkg libsecret-0.15-x86_64-1.txz
simply solved the problem.

Yet, I found the library's name (libsecret) is quite weird, up to par with libconfuse.

/usr/bin/nc: cpi

This band (netcat) is wickedly sick, releasing their album (Cycles per Instruction) as Linux kernel module!

The approach is pretty simple:
#include "../netcat.h" 
#define NETCAT_CPI_TRK1_LEN 624344 
struct netcat_track netcat_cpi_trk1 = { 
    .name = "Interrupt 0x7f", 
    .len = NETCAT_CPI_TRK1_LEN, 
    .data = { 
         #include "trk1data.h" 
    } 
};

It (the C header file) is actually a wavefile , you can redirect it to media player just as normal I/O operation. Just like silly "Hello world!" kprintf from kernel demo program you used to write on Intro to *NIX Operating System lecture.

Anyway, I am quite afraid there will be path issue between this netcat and the legitimate netcat.


Ganglia: gmond "Error creating multicast server"

Computers without IPv4 default gateway will likely force gmond (Ganglia monitor daemon) to spew something like this upon start.
Error creating multicast server mcast_join=239.2.11.71 port=8649 mcast_if=NULL family='inet4'. 
Exiting.

bubby (here) suggested to add static route to fix this problem, worked like a charm.
# route add -host 239.2.11.71 dev eth0

The guys at UCSF suggested the similar approach, though to quite-unrelated problem on multihomed computers here and here.

Building ganglia 3.7.0: ck

I was building ganglia 3.7.0 when suddenly this particular error message sprung out:

checking for CK... no
configure: error: Package requirements (ck) were not met:

No package 'ck' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables CK_CFLAGS
and CK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


Google showed up unrelated hits if you put ck library, duh!

It's actually ConcurrecyKit: concurrency primitives, safe memory reclamation mechanisms and non-blocking data structures designed to aid in the research, design and implementation of high performance concurrent systems.

--I mistook it with ConsoleKit and actually did this shameless thing:
# ln -s /usr/lib64/pkgconfig/ck-connector.pc /usr/lib64/pkgconfig/ck.pc

Some software engineers, especially related to high-performance parallel-concurrent system, really lack the taste of name-picking for their library.

.profile

It's definitely way too late. There's a server in my lab in which I've got my account there for over 2 years already, got .bashrc from my laptop there as long as the account.

It wasn't until today that I finally run:
ln -s .bashrc .profile
so that .bashrc is loaded every SSH login. Poor me.

USB Flash Boot Frenzy: Puppy Linux (2)

I always carry a flash drive consisting of several live Linux distros, of of them is Puppy Linux as I wrote previously here. But once the flash drive get congested with files, Puppy's kernel (and initrd) take too long to find it's squashfs.

The solution is simply to pass extra parameters to the kernel:
kernel /puppy/vmlinuz
append initrd=/puppy/initrd.gz pmedia=usbhd pupsfs=sdb1:/puppy/puppy_slacko_5.6.0.sfs

Make sure the path for squashfs image is correct otherwise you'll likely to get kernel panic.