zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Progress bar for DD

January 21, 2011 by Igor Drobot Leave a Comment


I am still searching for a perfect progress bar for DD, I know a dirty trick[*1] – put DD to background an sending “USR1” signal to bring it to show a progress – I hate this solution!

This one is not so dirty, but you have only the done progress and transfer speed.

1
2
dd if=/opt/wap/Backup.tib | pv | ssh -c arcfour id@tower "dd of=/home/id/Backup.tib"
1.94GB 0:01:15 [30.1MB/s] [<=>

dd if=/opt/wap/Backup.tib | pv | ssh -c arcfour id@tower "dd of=/home/id/Backup.tib" 1.94GB 0:01:15 [30.1MB/s] [<=>

Dirty trick:
Only local way!

1
2
dd if=/opt/wap/Backup.tib of=file.img bs=4KB& pid=$!
while true; do kill -USR1 $pid && sleep 1 && clear; done

dd if=/opt/wap/Backup.tib of=file.img bs=4KB& pid=$! while true; do kill -USR1 $pid && sleep 1 && clear; done

Filed Under: Bash, Debian, Linux Tagged With: dd, progress bar, transfer

Mount LVM from liveCD

January 21, 2011 by Igor Drobot 2 Comments

Yeah after installation of Windows seven – my Grub-Bootloader was removed and I get only the Windows bootmager.

This article describe hot to mount root “/” which was created on LVM from a live CD and install GRUB Boot-Loader.

Step 1: Get a live CD in my case it was Ubuntu 10.10 Desktop edition.
[Read more…]

Filed Under: Bash, Linux Tagged With: LVM, rescue

Squid visited sites

January 21, 2011 by Igor Drobot 2 Comments

You have a IP-Address from a PC, and you want to know which web-sites ware visited from this PC.

Grep for PCs IP-Address in the access log of your proxy box.

As result you will get a list with visited sites.

1
grep 172.16.0.5 /var/log/squid3/access.log | cut -d" " -f7 | sort -u | less

grep 172.16.0.5 /var/log/squid3/access.log | cut -d" " -f7 | sort -u | less

Filed Under: Bash, Linux Tagged With: Proxy, Squid

HDD temperature

January 13, 2011 by Igor Drobot Leave a Comment

Important hardware monitoring – check HDD temperature:

Install (Debian /Ubuntu way):

1
aptitude install hddtemp

aptitude install hddtemp

Check it:

1
2
3
4
hddtemp /dev/sda1
# Output:
# /dev/sda1: ST31500341AS: 42°C
# /dev/sdb1: ST31500341AS: 38°C

hddtemp /dev/sda1 # Output: # /dev/sda1: ST31500341AS: 42°C # /dev/sdb1: ST31500341AS: 38°C

1
2
3
hddtemp -n /dev/sda1
Output:
# 42

hddtemp -n /dev/sda1 Output: # 42

Filed Under: Bash, Linux, Monitoring Tagged With: hddtemp, Monitoring

Simple Python HTTP-Server

January 13, 2011 by Igor Drobot Leave a Comment


Sometimes I have to share some files over HTTP and I have no time to install apache or lighty. Everyone who has python can use SimpleHTTPServer module which can be started from command line.
Every request to your files will be logged to the terminal.

Start web server in some directory which should be shared:

1
2
[root@hexa-core webserver]# python -m SimpleHTTPServer 88
Serving HTTP on 0.0.0.0 port 88 ...

[root@hexa-core webserver]# python -m SimpleHTTPServer 88 Serving HTTP on 0.0.0.0 port 88 ...

You can change the port!

Logs:

1
pD4B88C85.dip.t-dialin.net - - [13/Jan/2011 21:57:01] "GET / HTTP/1.1" 200

pD4B88C85.dip.t-dialin.net - - [13/Jan/2011 21:57:01] "GET / HTTP/1.1" 200

Filed Under: Bash, Linux Tagged With: Python Webserver, SimpleHTTPServer

  • « Previous Page
  • 1
  • …
  • 5
  • 6
  • 7
  • 8
  • 9
  • …
  • 11
  • Next Page »
Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok