By cretox on 15/06/2016
Some time ago I found a somewhat old Netgear Switch.

Nice!
- 24 ports
- 10/100/1000
- Managed
- Double SFP!
Well, the first port is broken :)
And it’s too loud! In our lab we have already a file server and an UPS, powered 24/7.
This is the fan that make so much noise:

We need a solution to reduce the racket:
- Reduce the RPM? No, someone told me that there won’t be enough air intake to cool down the heat sinks: those can be very hot!
- Find another fan, same sizes but more quiet? I’ve could buy one, but we have plenty:

- Remove the original fan and apply some new tech :P

Fan, go home. You’re noisy.

Old twin fans, I choose you!

This would be a nice mod
The old fan power source is about 5V, but I’ve chosen to not care much as long as the new fans move air.
Pros already love me!
Let’s begin with some tough work.
1. New holes on top


Metal is hard!


Done!
2. Mounting new fans and cabling



3. Results:

Farewell nice logo!


Posted in General
By cretox on 10/03/2016
$ echo $SHELL
/bin/rbash
$ /bin/ls
/bin/bash: line 2: /bin/ls: restricted: cannot specify `/' in command names
$ awk 'BEGIN{system("/bin/bash")}'
$ /bin/ls
foo bar misc
$ uname -rm
2.6.18-308.16.1.el5 i686
$ bash --version
GNU bash, version 3.2.25(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
$ awk --version
GNU Awk 3.1.5
Copyright (C) 1989, 1991-2005 Free Software Foundation.
$ exit
$
Posted in General
By cretox on 01/01/2015
First, install nodejs and npm from repository.
Then:
sudo update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100
mkdir -p ~/.new-dir
npm config set prefix /path/to/.new-dir
npm install -g ember-cli
PATH="$PATH:/path/to/.new-dir/bin"
Export PATH variable in your bashrc to avoid retyping.
Test with:
ember -v
Posted in General
By cretox on 17/12/2014

Best feature ever? Double dictionary check!
Now guess the program.
Posted in anvedi, FLOSS
By cretox on 11/11/2014
Oooooh:
$ cat list | grep some | awk '{print $1}'
Oh my god, 3 processes, we’re all gonna get a SIGKILL!
Then:
grep 'some' list | awk '{print $1}'
What? Not yet..
awk '/some/{print $1}' list
\é/
And I count my lines with:
grep -c 'some' list
instead of wced-greped-cated
Posted in General
By cretox on 05/11/2014
How nice:
$ alias dls='tree -phugsCD --du'
Add ‘-f’ for more fun!
(Other useful options: ‘-a’, ‘-x’, ‘-L <level>’, ‘- -sort=size’)
Posted in General
By cretox on 22/09/2012
La vignetta[1] è assurda e troooppo grande per girarla tutta…
Forse l’artista pensava fosse cosa divertente!
A me non piace quando mi nascondono le cose. Così mi son messo e ho cercato di capire come funzionava il tutto.
Possibile ci sia un’immagine di fantastilioni di px tutta intera?
Come funziona il motorino per farmene vedere solo un pezzo? (bastardo)
Ma soprattutto, come faccio ad avere Il Tutto™ ?
La cosa è gestita in JavaScript + altro, credo, non ho studiato quindi non ci capisco quasi nulla: ci son due scriptini, ma io voglio la vignettona!
Entrando in dev-mode di Firefox o anche da page-info noto che tutta la vignetta è spezzata in tante sub-vignette (da 2048x2048px !!).
La cosa fantastica è che hanno nome-file con un senso, cioè il nome di ogni sub-vignetta è effettivamente una coordinata NSWE.
Urge disegnino.

Quindi conoscendo il valore degli estremi posso… *_*
Bash è mia amica:
#!/bin/bash
for ns in n s ; do
for ew in e w ; do
for ver in {1..20} ; do
for hor in {1..50} ; do
image="${ver}${ns}${hor}${ew}.png"
if [[ ! -e "$image" ]] ; then
#ranz=$[RANDOM/1000]
ranz=$(shuf -i 1-12 -n 1)
wget -q --user-agent="Mozilla/5.0 Firefox/10.0.1" http://imgs.xkcd.com/clickdrag/${image}
if [[ "$?" -eq "0" ]] ; then
echo -ne "${image}\tDONE!\t"
else
if [[ "$image" == *n*.png ]] ; then
cp white.png ${image}
else
cp black.png ${image}
fi
echo -ne "${image}\tCreated..."
fi
echo -e "\t(wait ${ranz}s)"
sleep ${ranz}
else
echo -e "${image}\tAlready here..."
fi
done
done
done
done
- Sì, è brutto.
- Ho usato come limiti ’50’ in orizzonatale e ’20’ in verticale tanto per essere sicuro di prendere la grande fetta, i valori massimi che ho trovato sono ’48’ e ’18’, non so come fare per sapere i reali confini.
- $[RANDOM/1000] mi dava valori per la pausa tra una presa e l’altra troppo alti (fino a 32 sec). Recentemente ho trovato un Coreutils Cheat Sheet (catonmat.net), quindi scopro ‘shuf’.
- L’user agent è solo per bellezza, xkcd.com non fa controlli del genere a quanto pare (non nell’immediato).
- La condizionale per il ‘già qui’ è lì solo perché ho fatto molte prove.
- Il furbacchione non ha effettivamente messo quei tasselli tutti bianchi o tutti neri (qualcuno anzi sì). Quindi li creo io! (in base alla posizione N/S)
- Non si usa `ls’ a questo modo!
Adesso che ho tutti i tasselli della vignetta, devo semplicemente unirli per… erh… Uso ‘convert’ con spezie.
Creo tutte le strisce orizzontali:
for i in {1..20} ; do
convert $( ls ${i}n*e.png | sort -V ) +append ${i}n_eF.png
convert $( ls ${i}n*w.png | sort -Vr ) +append ${i}n_wF.png
convert $( ls ${i}s*e.png | sort -V ) +append ${i}s_eF.png
convert $( ls ${i}s*w.png | sort -Vr ) +append ${i}s_wF.png
done
Quindi le unisco in verticale e creo i quattro riquadri:
convert $( ls *n_eF.png | sort -Vr ) -append NE.png
convert $( ls *n_wF.png | sort -Vr ) -append NW.png
convert $( ls *s_eF.png | sort -V ) -append SE.png
convert $( ls *s_wF.png | sort -V ) -append SW.png
Unisco il tutto:
convert NW.png NE.png +append N.png
convert SW.png SE.png +append S.png
convert N.png S.png -append xkcd_1110.png
Mamma guarda ho fulminato il computer!
[1]XKCD #1110
Posted in anvedi, scriptz
By cretox on 16/07/2012
Occorrente per forgiare lo strumento:
- mettere nel cassetto il nastro isolante
- due prolunghe ATX 20pin (24 se siete alla moda) [0]
- forbici o spellafili
- guaina termorestringente 2.5mm
- accendino
- fascette
- tempo e pazienza
Mischiare il tutto ed improvvisamente…

Non resta che provarla.
[0] come si vede dalla foto, ho usato la bocca di una da 24, solo perchè avevo quella, tanto è uguale
Posted in tech
By cretox on 12/07/2012
Non si accende. ACCENDILO.
Non funziona. FUNZIONALO!
Posted in arghh!, tech
By cretox on 16/06/2012

Fate Attenzione Illudiamo Lavoratori
Posted in blender, gimp, macero