Sunday, December 8, 2013

emacs image-dired mode fixing "Thumb could not be created" thing

Ah, emacs's dired-mode... if you don't know it, do "C-h r m Dired" on your emacs right now (do Image-Dired instead for image dired mode too).

You need to have a few extra packages for image manipulation installed, but it's like the only descent/realistic way to manage (a large number of) image files I know...

"Thumb could not be created  for file ..."

This error can be annoying. In my system with:
GraphicsMagick 1.3.12 
emacs-24.3

If you have all the necessary packages and all, then probably it's because of the "strip" option used by default by image-dired-mode to make thumbnails/resize original files.


Adding this to your .emacs file should fix it.
(setq image-dired-cmd-create-thumbnail-options "%p -size %wx%h \"%f\" -resize \"%wx%h>\" jpeg:\"%t\"") ;; remove -strip option
(setq image-dired-cmd-create-temp-image-options "%p -size %wx%h \"%f\" -resize \"%wx%h>\" jpeg:\"%t\"");; remove -strip option
;;(setq image-dired-external-viewer "/usr/bin/xzgv");; a viewer I like, just in case you're interested

As an extra advice for image-dired noobs, having a 3 window emacs frame is probably the expected thing for having it working. One for dired-mode, the other for the thumbnails of image-dired, and the other for the larger preview/original size pic.
It let's you add comments/tags in an emacs exclusive "database" file, so you can manage/search for images pretty easily and fast.

Sunday, November 17, 2013

my "bodybulding" training

In results:
Before / After
  

These are my results for my 3.5 months of training.
Bulk up: 3 months ( +4 kg, +2% fat, +900g of muscle)
Reduce fat: 2~3 weeks (- 2.5kg, -1% of fat, -50g of muscle).

If you're like me and want to look more like Arnold Schwarzenegger, rather than a simple thin guy, please keep reading. If not, please leave the page.


After drinking alcohol pretty much 3~4 times a week and having a super unhealthy diet and lifestyle after being dumped by fiance, I looked a lot worst that in the "before" pic.
I hit the bottom of the bottom of my life so far at least in self-destructive/depressively speaking.
Leaving aside "why" I began training, it was something I had been wanting to do a long time, but didn't have the money/time/will till now.
Apparently I have good genes for muscle development, which helps. After 2~3 years, I expect to look more like a real bodybuilder.

There are many stories out there around how a certain diet/fitness training can help you do this kind of change in your body. But most of it is sh*t. And believe me, the worst thing you can do is do a ketosis diet, like eating once a day, or having days without eating anything. You only do that kind of thing if you have some kind of trauma for being a f*cking fatso for long, and having no idea of how to change that and being totally desperate.

You'll basically need:
  1. a gym subcription / + optional sport or fitness recreational activity (me: capoeira/brazilian jujitsu and mountain biking) 
  2. a microwave, fridge, and basic cooking skills (you'll begin bodybuilding cooking)
  3. time to rest and sleep
  4. track recording tool (notebook, etc. I use a database in my computer)
  5. calories calculating tool (notebook, etc. I use a lisp program I made)
  6. the will to improve yourself or kill someone so much you'll stick with the plan

About one third of all is in the gym, and how you develop your musculature using the progressive overload principle. Go to youtube or something, and watch the Joe Weider's training tapes. If you want to look a bodybuilder, you gotta train like one.
The other two thirds are about the time you take to rest your body /sleep, and how you calculate your diet.
You can do the diet change gradually, having to better have about 40%, 50%, and 10% of protein, carbohydrates, and fat daily. With the amount of calories being higher than the amount you need --- get in an over calories diet --- (in the bulk up phase, where you generate the amount of muscle you want, fat will be generated too, don't worry about it you can get thin anytime, it's super easy when you begin understanding your body and how it uses the food you take).

The basic cooking skills part is nice too. Especially since you're like me and never cooked before, and think the best food you have had is whatever your ex-gf or her mom had made for you. Everything will taste better when knowing that's what your body requires, and how it be used by it. Read in sites like bodybuilding.com about simple/complex carbs, protein, fat, and experiment on yourself about what suits your body better. You'll probably be making your food in bulk ilke twice a week, and heating stuffs with a microwave everyday. (From my second month of training, I started eating 5~7 times a day, bringing packed food to the office). Oatmeal, non-stick-spray (cooking oil spray) and baked chicken breast, brown rice, (especially sweet) potatoes, eggs/milk, and of course protein shakes and supplements will be your strongest allies.

Weight yourself everyday to keep record, as well as write down everything you eat, and it's nutrition values so you can make sure you're having enough calories and carbs/protein, or if you get too fat, how much is too much for you.
Also take pics of yourself once every 2 weeks, which will help keep record of how your body changes (you really don't notice when looking yourself at the mirror everyday, although probably your friends do).
An occasional junk food/eating out meal is OK. But if possible, stay away from alcohol, that's not only for bodybuilders, if you want to stay healthy in general...

Some people say I look ripped/muscular enough now, but I want to get bigger, so I'll keep bulking up again for a while. Really, this changes your life in so many ways I wish I had started it long time ago. Now I can cook pretty good (which also makes your life cheaper if you were used to eat it out), look a lot better, and feel a lot more confident of martial arts skills as well... which can't hurt (me).

Friday, August 9, 2013

omg lavabit.com is down...

I had been using this account for so long, and it's down all of the sudden><...

I guess the only options I have are either renting a server (having to pay monthly!), or use gmail... none of which can really be told to be very free (as in freedom).
Argh, if any of you have any good mail provider suggestions...

Sunday, August 4, 2013

The cheapest usable cellphone in Japan

Update

Now you can get a super cheap SIM-free cellphone in Japan by many companies (let me recommend "rakuten mobile"...), with a phone number and everything, so this is kind of outdated.



Japanese cellphone companies can be crazy.
They have some very hard to get bills, lots of plans which don't make much sense, and since the moment you sign the contract they usually will make you get in for some plans you don't plan to use but "need" to sign first in order for the campaign to apply, of which without it'd be even more expensive...

I used the Japanese company au's cellphone for a while, for about 7,500JPY per month. Then softbank, for about 9,000JPY per month...
That's pretty much my cellphone to receive emails, browse the web a bit while on the train, and get occasional phone calls. So it's pretty much a big waste of money...

Then, thanks to IP phones... we can get something a lot better, a lot cheaper! The services are:
Rakuten fusion smart phone (SIP phone number)
Rakuten LTE

LTE just refers to the (micro-)SIM chip you get to connect your cellphone to a Japanese cellphone network (docomo's) and use internet. And the SIP phone number is the thing that lets you do/receive phone calls via internet, you can also use it from your computer as you can guess (use Ekiga on GNU/Linux).

The SIP phone number DOESN'T have a basic fee per month. And you can make phone calls for free to most IP phone numbers (050- numbers). That means as long as you only receive phone calls, you'll be talking for free. And it's cheaper to make phone calls than from regular cellphone's phone numbers.
The bad thing, is that as you can guess, it relies on your network... If you are in a remote area, and your internet connection is kinda slow or doesn't respond very fast, you'll have a bit of a lag during the call. Kind of when you make a long distance phone call.

LTE works just fine, it has a basic fee from 875JPY to like 2,980JPY per month, depending on the bandwidth plan you choose. These are some very easy to understand plans...

The "bad" thing, is that you have to buy the cellphone in advance by yourself, and do the setup (put the SIM chip into the phone) by yourself. But that's pretty reasonable for the price you get, being that I pay like 900~1,500JPY monthly for this phone... about 6 to 9 times cheaper than I used to.

Monday, February 11, 2013

Running quakelive on GNU/Linux

After getting a decent video card, the next obvious thing to do is to at least try it with a game...

quakelive.com is a nice one! (lots of actual free games out there to try to though)

I'm using debian, so I'll use iceweasel instead of firefox.

1. run iceweasel
2. go to quakelive.com and register + get the plugin file (QuakeLivePlugin_520.xpi)
3. mkdir -p ~/temp/quakelive; cd ~/temp/quakelive; unzip QuakeLivePlugin_520.xpi; cd ./plugins
4. depeneding on your architecture, copy the file npquakelive.i386.so or npquakelive.x64.so to ~/.mozilla/plugins
5. restart iceweasel
6. go to quakelive.com again, and it'll say plugin OK and start downloading the rest of the game! After that you'll be able to play.


GEFORCE GT610 video card in dell poweredge 840 server

And, trying to ignore reality, the only thing sane to do is to try to think something else real hard. Luckily I have lots of tasks like that.

I installed a GEFORCE GT610 in my new dell poweredge 840 server (I use my server as a desktop computer).
Model name GF-GT610-LP1GH, with 1 GB of video memory, pretty fast, and the best, works with a 32 bit PCI bus! (not pci-express!)
My computer has 1 32bit PCI bus, and two PCI-X (not express, eXtended! which is like a 64 bit PCI bus), so the card fits in any of these (you can put a 32 bit PCI card into a PCI-X one).

Maker page: http://kuroutoshikou.com/modules/display/?iid=1720

Official drivers for GNU/Linux (32 and 64 architecture available): http://www.nvidia.com/Download/index.aspx?lang=en-us

I'd prefer to use free software or at least open source for this kind of thing... apparently there are some options in the repositories (sudo apt-cache search nvidia). Please check those out too, I know I will...

How it goes:
1- Install the card in the server
2- Boot. You'll hear some beeps, and it'll take a lot longer than usual depending on your kernel
3- Depending on your X settings, you'll get no output to the monitor after the POST and maybe the init scripts have run.
4- If you get no output from your monitor (I didn't!), use ssh to login to your computer, run the file you get from the official drivers download page (chmod +x NVIDIA-Linux-x86-310.32.run; ./NVIDIA-Linux-x86-310.32.run)
5- You'll get compiled the kernel modules for the video card and your /etc/X11/xorg.conf settings will be changed ( notes on that below)
6- reboot
7- Cross your fingers and after probably a lot longer than you're used to, you'll see how the init scripts run, and you get your X session looking quite pretty!

Problems:
- the grub menu screen won't show... so right now I can't choose anything but my current default kernel/initrd on startup. This probably won't be so hard to fix
- the server won't halt! (it takes a lot to shutdown!)... yes, I guess the modules aren't working perfectly or something. I guess re-compiling your kernel for multiple displays support would fix it. Or at least trying a new kernel...
- it takes so long to boot! There's a pause between the grub start menu thing, and the actual initrd scripts running. I guess this is due to the kernel as well.

But besides that, it works perfectly!! I can finally see high-resolution videos without having to scale them smaller or dropping frames, and even better, I can finally play on my computer decently! I just tried quakelive without any trouble!


Random information:
computer: dell poweredge 840
OS: Debian GNU/Linux 6.0, kernel: 2.6.26-2
added lines on /etc/X11/xorg.conf:

$ bzr diff xorg.conf|grep +
--- xorg.conf 2013-02-11 07:06:13 +0000
+++ xorg.conf 2013-02-11 07:24:07 +0000
@@ -1,57 +1,54 @@
+# nvidia-xconfig: X configuration file generated by nvidia-xconfig
+# nvidia-xconfig:  version 310.32  (buildmeister@swio-display-x86-rhel47-09)  Mon Jan 14 15:46:49 PST 2013
+
+Section "ServerLayout"
+    Identifier     "Layout0"
+    Screen      0  "Screen0"
+    InputDevice    "Keyboard0" "CoreKeyboard"
+    InputDevice    "Mouse0" "CorePointer"
+EndSection
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    # generated from default
+    Identifier     "Mouse0"
+    Driver         "mouse"
+    Option         "Protocol" "auto"
+    Option         "Device" "/dev/psaux"
+    Option         "Emulate3Buttons" "no"
+    Option         "ZAxisMapping" "4 5"
+EndSection
+
+Section "InputDevice"
+    # generated from default
+    Identifier     "Keyboard0"
+    Driver         "kbd"
+EndSection
+
+Section "Monitor"
+    Identifier     "Monitor0"
+    VendorName     "Unknown"
+    ModelName      "Unknown"
+    HorizSync       28.0 - 33.0
+    VertRefresh     43.0 - 72.0
+    Option         "DPMS"
+    Identifier     "Device0"
+    Driver         "nvidia"
+    VendorName     "NVIDIA Corporation"
+    Identifier     "Screen0"
+    Device         "Device0"
+    Monitor        "Monitor0"
+    DefaultDepth    24
+    SubSection     "Display"
+        Depth       24
+    EndSubSection
+


Just a quick update

It stopped working in the upgrade to debian 9. It works perfectly on debian 8. I tried an ubuntu live DVD without success too.
I think X is the reason so maybe you could make it work by keeping the X server in the same version as debian 8. But it was too much of a trouble for me so I just kept it on debian 8.

Pics?

I inserted the card it in the slot_5 (the bottom one)