My hacking journal

ZYBNET

last update:

Starting point: a container with N elements: one is float: right and the rest is float: none. If you set overflow: hidden on a float: none box it will not overlap the floating siblings. In this screenshot, the semi-transparent red box is float: right, and the yellow box is overflow:hidden And here you what happens when overflow: visible is applied to the yellow box: Play it on JSBin This is because elements with overflow: hidden estabilish a new block formatting context and

I don’t know C, but as a seasoned Java programmer (not to mention that I do a lot of scripting) I really didn’t expect: Makefile are idiotic (tab is significant!) You need those stupid header files Shared Objects are a mess The order of the arguments on the GCC command line matters!

The driver is supplied by this PPA, so: sudo add-apt-repository ppa:lekensteyn/wacom-tablet sudo apt-get update sudo apt-get install wacom-dkms Then we need a program to draw: MyPaint sudo apt-get install mypaint mypaint-data Happy drawing! :)

This is the command to extract a piece from a video file in the most efficient manner:

ffmpeg -ss $START -i "My 21st Birthday" -t $DURATION -c:v copy -c:a copy "Funny moment.webm"

Where

  • $START is the start moment, in hh:mm:ss[.mmm] format

  • $DURATION is the length in the same format as above

Note that in this case the order of parameters matters! If the input file is given before -ss, ffmpeg will still decode the streams from the beginning of the file. Instead, if -ss is given first, the streams are first seek’d, and only after the start point decoding begins.

Android tricks

This post will gather all those little tricks that speed up your Android development, because I found I often get stuck because of poor documentation.

Better than grep! On Ubuntu, you need to install the package ack-grep (oddly, the executable is also named ack-grep…) Examples: find the usages of the variable $secret in the PHP files $ ack-grep --php '\$secret'

Nowdays the best way to access remote Git repositories is through the HTTP transport. However most service still offer SSH connectivity, and there are times when you want to access different hosts with SSH identities different than the default one (id_rsa). Useful links

Disclaimer: I pasted content from the aforementioned sources. I hope I have the time to review it and clarify and make it my own. For the time, it’s only a reference for myself.

If you have an active _ssh-agent_ that has your id_rsa key loaded, then the problem is likely that _ssh_ is offering that key first. Unfuddle probably accepts it for authentication (e.g. in sshd) but rejects it for authorization to access the company repositories (e.g. in whatever internal software they use for authorization, possibly something akin to Gitolite). Perhaps there is a way to add your personal key to the company account (multiple people are not sharing the same corp_rsa public and private key files, are they?).

Google OpenID URL

I’ve always thought that the URL for my Google OpenID were something like http://google.com/account/RaffaeleSgarro. Instead, it turns out that when a site request that URL to sign up (and in the case it doesn’t provide a Google icon), you can simply enter https://www.google.com/accounts/o8/id and it will redirect you to the Google server to confirm the authorization, and then back to the original site

MySQL Recipes

  • Table management (create, alter table)

    • Foreign keys

    • UTF-8 as default character set

    • Know the actual column encoding

    • Variables

    • Useful tips

    • Easily reading query output wider than the terminal