domingo, 27 de noviembre de 2016

Install Wifislax 4.12

Putting wifislax in a usb stick is a bit unlike most other distros.

  1.  copy it with dd, or unetbootin. 
  2. run ./boot/
  3. when it fails with "error while loading shared libraries: cannot open shared object file: No such file or directory".
  4. ln -s /lib/x86_64-linux-gnu/ /usr/lib/
  5. rerun  ./boot/ 
  6. Audit!

martes, 22 de noviembre de 2016

TIL: Oneliner http endpoint

Today I was looking for some 'Taco Bell' way to create an http endpoint in a server that would output very basic stats about the server.

In this stackoverflow thread I found a pretty neat way to do it.

 while true ; do nc -l -p 1500 -c 'echo -e "HTTP/1.1 200 OK\n\n $(lsof -a -p $(pgrep myprocname) | wc -l)"'; done

Nice, eh?

miércoles, 19 de octubre de 2016

TIL: highlight jira's comments

At (sys:getenv "WORK") we use JIRA as an issue tracker.  An issue tracker you can hate as much as any other issue tracker (maybe even a bit more).

The problem at hand today is that I can't see the highlighting of the focused element in jira in my screen (depending on the lights and reflection), and in long threads, it makes impossible to see what is the comment that I'm supposed to be looking at.

The tip for today is to overwrite css for some sites.  In conkeror we could add the configs in .conkerorrc but it seems firefox (keysnail for that matter) makes us use a userContent.css which belongs to a profile.

For me, I had to edit the file "/home/rgrau/.mozilla/firefox/c32dsif..default/chrome/userContent.css"

and add this:
@-moz-document domain( {
    .focused { border: solid 1px !important; }
    /* .focused { background-color: red !important; } */

viernes, 2 de septiembre de 2016

Flickering thinkpad x220 screen

My thinkpad's screen start flickering one month ago. It was just a column 1/4th of the width (maybe 1/6th, can't remember now).

I was horrified by the fact that I may have to buy another laptop, but fortunately, it was a matter of 100euros for the  LCD.

Watch this for a nice guide on how to change the LCD without messing with unnecessary parts. And enjoy a really nice soundtrack .

So, and today I read in /r/emacs that the CTO of Opera software is a heavy user of emacs, and owns an X220. That's what he says about X220.

martes, 30 de agosto de 2016

slime inspect + eval

When inspecting some value in slime-inspector, you may want to evaluate forms on that value.

That's what 'e' `slime-inspector-eval' is for.  What the docs do not put very clear is that '*' is the variable bound to the value.

domingo, 7 de agosto de 2016

Setting the date of my raspberry pi

I use my rpi as an alarm clock.  It works well because you have mplayer and cron.  And that's basically it.   I used picolisp to wire everything together (and wrote a simple hack to snooze the alarm).

But one of the biggest annoyances is that Rpi doesn't have a clock on its own, so when it looses power (I disconnect it), the clock is reset, so the alarm clock won't work.. :(

As I've read "The Unix Programming Environment" lately, I'm quite fond of shell scripts now, and I got to this 4 level quoting that sets the date of my raspberry pi from my laptop.

ssh pi@ -o ConnectTimeout=60 sudo date --set="\"`date '+%d %b %Y %H:%M:%S'`\""

I'm somewhere between very proud and very ashamed of that, but well... it does the job.

lunes, 25 de julio de 2016

git pre-commit blacklist

Here's a simple solution if you want git to not allow you to commit debug messages or blacklisted words.

The nice thing about the snippet is that it only counts added lines, not removed, so you can clean code with this pre-commit active, but never make it worse.

git diff --cached | grep '^+' |  grep -n $FORBIDDEN && \
 echo "COMMIT REJECTED Found '$FORBIDDEN' references. Please remove them before commiting" &&\
 exit 1