zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

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

Nginx and Apache2

January 18, 2011 by Igor Drobot Leave a Comment

I decided to put a nginX (pronounced as ‘Engine X’) as my primary webserver to reduce the server load and improve performance.

Nginx can only handle static content (CSS, simple HTML, and static files) l have to proxy incoming dynamic requests to another server, in my case Apache2 with PHP5 as suExec/ Fcgid.

[Read more…]

Filed Under: Debian, Linux Tagged With: apache2, load, Nginx, Performance, Proxy

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

Show MySQL restore progress

January 13, 2011 by Igor Drobot Leave a Comment

Sometimes if I work with really huge MySQL databases, I miss the progress bar of the restore progress.
I found a little solution to see the progress Bar

Description:
pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

1
2
pv database.sql | mysql -D databasename -pyourpassword
948.4MB 0:00:03 [22.7MB/s] [=====>               ] 21% ETA 0:00:11

pv database.sql | mysql -D databasename -pyourpassword 948.4MB 0:00:03 [22.7MB/s] [=====> ] 21% ETA 0:00:11

Filed Under: Linux, MySQL Tagged With: database restore, MySQL

  • « Previous Page
  • 1
  • …
  • 49
  • 50
  • 51
  • 52
  • 53
  • …
  • 74
  • 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