Sunday, October 30, 2011

print a binary number in octal using emacs lisp

(format "%o" #b10110)

As in the emacs lisp reference (info page),
#b is for binary numbers
#o is for octal numbers

After you define something, you can just print it with format. With %o for octal, %d as decimal, and %x for hexadecimal.

You can print numbers to binary using calc mode (M-x calc)
typing
the number
RET
d2




connect to a VPS server remote desktop with linux

It's so annoying, when you are a free software believer/supporter, and you are asked to do something in windows (that piece of **** they dare call an OS that keeps bugging me or being just totally inefficient for any complex task).
When your salary is in the line, it's hard to say no.
Anyway, for those cases, you can always get a cheap VPS (virtual private server), and use it there.

You can connect to it using the remote desktop protocol, an ugly thing they have because they have no real terminal (can't use ssh), and don't use X. As you can guess if you use GNU/linux, depending on the server's distance, this can be really slow!

Linux clients

You can connect to it using GNU/linux, with clients like:

  • remmina (GUI) : easy to use and set
  • rdesktop (CUI) : copy paste between client and remote machine works!
    you can run it like this:
    rdesktop -K -f -b -a 8 -u your_usename -p 'your_password' your_servers_IP &

If you're looking for a good VPS service, the ultrahosting.com guys gave me a good and cheap solution.


if you want a vps server, don't go to kickassvps.com

Being in the need of a VPS server, I tried kickassvps.com.
Result: they cancelled my order without any reason after sending me an invoice and everything... If I hadn't sent an e-mail to their support, they probably wouldn't even had the courtesy of informing me of that.

This is the mail you receive when you sign in:


Thank you for signing up with KickAssVPS.com! You have been added as a customer and you can now login to our client area using the details below.


If you have ordered a CloudVPS Server, you will receive a Welcome Email  shortly with instructions for setting up and provisioning your CloudVPS Server  from the Client Portal.


For Windows and Linux VPS servers, we will have your account configured within 24 hours. The login and server details will be sent to this email address once setup has been completed.  

#my username and password go here

I got my credit card payment confirmation and everything. After not receiving the e-mail as they said, I contacted them.
Here's what their answer looked like:


Due to issue during the background check, we were unable to accept your order. Any payments have been refunded.



Thanks,


As you can imagine, being in need of the service kind of in a hurry, this was very disappointing, as well as irritating. This guy obviously doesn't give a crap whether I need the service or not, and is not taking any kind of responsibility. Most of the e-mail is just a template. Fuck it, I'll never have to do anything with these guys again. In contrast to that, the guys at ultrahosting.com were very welcoming, fast, and even give me support as requested. Why the hell are so many few posts about this kind of thing anyway...

Monday, October 17, 2011

convert all pdf files in current directory to jpgs

for FILE in *pdf ; do echo "processing $FILE"; pdftoppm $FILE |ppmtojpeg > `basename $FILE .pdf`.jpg ; done