ATA over Ethernet for Windows
I am writing some backup scripts for a server, and I needed a way to let the root user on the machine to login to PostgreSQL as 'postgres' user to perform some administrative operations.
To do so, I had to make a few changes to the configuration file, to let the root user to authenticate via local-socket without providing a password (the script is launched automatically by cron, no user interaction needed).
/etc/postgresql/8.3/main/pg_hba.conf
1 2 |
# TYPE DATABASE USER CIDR-ADDRESS METHOD local all postgres ident rootaspg |
This is a small bashscript i wrote to backup my mobile phone addressbook into LDIF format to import in LDAP. It uses gnokii to dump the phone/sim addressbooks.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/bin/bash OUTFILE="./addressbook_$(date +"%Y%m%d-%H%M%S").ldif" ERRLOG="/tmp/gnokii-backup-errlog-$(pwgen 10 1).log" echo > "$OUTFILE" echo -n "Backupping SIM memory ... " gnokii --getphonebook SM 1 end -l >> "$OUTFILE" 2> "$ERRLOG" && echo "[ DONE ]" || echo "[FAILED]" cat "$ERRLOG" | sed "s/^/ /g" rm "$ERRLOG" echo -n "Backupping PHONE memory ... " |
How to define custom headers into mutt and attach files?
To run mutt in batch-mode (without user interaction) passing custom headers to it, you can use the my_hdr command, appending the -e parameter:
-e "my_hdr From: My User"
To attach files, use the -a parameter:
-a ./file-to-attach.tgz
And directly pass the mail body on standard input and the subject with -s
So, a command to send an e-mail could be:
Updated: 2009/11/20 00:44
Yeah, maybe I am a bit paranoid, but I want to know in real-time who logs into and from which address to my machines.
Since logging that to file is too much insecure (if one gets the control of the machine, he can delete every file he wants..) I built a script that sends me an alert e-mail each time a user logs in.
It uses mutt to compose an e-mail attaching the output of some commands.
The script is quite simple:
To list the hardware on a machine, use lshw:
Gentoo: sys-apps/lshw
Debian: lshw
$ lshw --help
Hardware Lister (lshw) - B.02.13
usage: lshw [-format] [-options ...]
lshw -version
-version print program version (B.02.13)
format can be
-html output hardware tree as HTML
-xml output hardware tree as XML
-short output hardware paths
-businfo output bus information
-X use graphical interface
options can be
-class CLASS only show a certain class of hardware
Version: 1.09 December 28, 2008
By: darkAudax
Italian translation: ~redShadow~
Questo tutorial illustra un semplice caso di cracking di una chiave WEP. Lo scopo di questo tutorial è fornire le conoscenze basilari e rendere familiari con i concetti. Assume che tu abbia una scheda wireless funzionante con i driver già patchati per l'iniezione di pacchetti.
Quante volte capita di avere a che fare con file di varia provenienza a cui l'autore si è sbizzarrito a dare nomi assurdi contenenti, oltre a spazi, perfino caratteri in utf-8 ecc..?
Questo script serve per cercare di rimettere un po' a posto le cose, sostituendo spazi con underscore, lettere accentate con lettere "normali", ecc..
..ecco qua un nuovo modulo per Drupal! :)
E' un semplicissimo browser per le pagine del manuale UNIX ('man'), cosa che trovo molto comoda, soprattutto per funzioni di ricerca ecc.. ecc..
Al momento, i sorgenti sono disponibili via SVN su http://svn.hackzine.org/drupalmodules/modules/manpages/ (in particolare si veda il branch 6.x-0.x):
svn co http://svn.hackzine.org/drupalmodules/modules/manpages/branches/6.x-0.x/ manpages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/usr/bin/python """ CountDown.py v0.1 - a simple countdown app Copyright (C) 2009 Samuele ~redShadow~ Santi - http://www.hackzine.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULA |
Spesso ci si chiede come sfruttare appieno i vari "tasti speciali" presenti sulla maggior parte delle tastiere recenti, magari personalizzando anche un po le varie funzioni.
Una metodo comodo di fare ciò è keytouch (http://keytouch.sourceforge.net/), che permette una comoda gestione delle funzioni assegnate ai vari tasti.
Sulla gentoo, gli ebuild da emergere sono:
Su consiglio di mavimo ho deciso di provare OpenFOAM.. già che ci sono, pubblico i passi da seguire per l'installazione su Gentoo:
Per procedere occorre avere layman installato. se così non fosse:
1 |
# emerge app-portage/layman |
..una volta installato
1 |
# layman -L |
dovrebbe ritornare la lista degli overlay disponibili.
Quello che interessa a noi è:
1 |
* sunrise [Subversion] (source: http://overlays.gentoo.org...) |

This tutorial is about how to set up a crypted partition on linux using dmcrypt.
Of course, you can use either fisical partitions or files using a loopback device.
A loopback means that you have a file that is on a partition that you then mount using a special device called a loopback. The loop device then acts as a normal block device transforming your file into just another hard disk :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/bin/bash # # archive.sh - A fast archiver, useful for making snapshots # Copyright (C) 2008 Samuele ~redShadow~ Santi # http://hackzine.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY |
Ecco il mio primo programma su arduino.. :D
Un sistema fantastico per regolare il volume della scheda audio.. leggendo il valore di un potenziometro!
Decisamente una cosa utile, ma a parte quello..
Pagina sul wiki: http://doku.hackzine.org/projects/arduino/volume_changer
Come avrete notato, sono uno che non aggiorna un blog per un mese poi scrive di fila 3 post linkando articoli scritti sul wiki (che consiglio di andare a vedere se volete roba fresca :D)..
Questa volta, linko un howto che ho scritto per spiegare la procedura per redirigere la console del kernel e aprire poi un login sulla porta seriale (o su un altro device a caratteri)..
Pubblico anche altri due script comodi che ho realizzato:
archive.sh
Scriptino bash per creare velocemente archivi di backup di una cartella, includendo nel nome del file data e ora
http://doku.hackzine.org/scripts/archive
bulkchmod.sh
Script per cambiare velocemente e ricorsivamente i permessi su file/cartelle con un comando del tipo
bulkchmod 755 644 /path/to/files
http://doku.hackzine.org/scripts/bulkchmod
Rendo finalmente disponibile al pubblico (cioè mi decido a pubblicare.. :D) il codice di uno script realizzato tempo fa per creare un'effetto "sabbia colorata" sullo schermo, modificando il framebuffer direttamente da python senza librerie aggiuntive..
Il link all'articolo sul wiki (in inglese..):
http://doku.hackzine.org/scripts/pxsand.py