iptables - passive FTP NAT

2012-03-26 by xpheas
BASH-Code:
1
2
3
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

BASH-Code:
1
2
iptables -t nat -A PREROUTING -d xxx.xxx.xxx.xxx -p tcp --dport 21 -j DNAT --to-destination 192.168.122.25:21
iptables -I FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT

xxx.xxx.xxx.xxx = public IP-address
192.168.122.25 = private IP-address

  » comments (1)

Find all symlinks

2011-10-29 by xpheas
BASH-Code:
1
find / -type l -exec ls -l {} \;

Ubuntu 11.04 OneiricOcelot Gnome2

2011-10-25 by xpheas
Today i upgraded to Ubuntu 11.04 OneiricOcelot.

The classic Gnome2 Desktop is gone. Gnome3 Shell or Unity is no option for me. The only usable option is to use Gnome3 in classic mode.
BASH-Code:
1
sudo apt-get install gnome-session-fallback

Logout an choose "GNOME classic" in the options menu.
So, this is only a fallback mode, to get 3D effects edit
/usr/share/gnome-session/sessions/gnome-fallback.sessions
and change/add some values:
BASH-Code:
1
2
3
4
5
6
7
8
[GNOME Session]
Name=GNOME fallback (Safe Mode)
RequiredComponents=gnome-panel;gnome-settings-daemon;
RequiredProviders=windowmanager;
DefaultProvider-notifications=notify-osd
DefaultProvider-windowmanager=compiz
DefaultProvider-panel=compiz
DesktopName=GNOME

To add applets to the panel you have to press ALT + right click on the panel instead of just right clicking.

  » comments (0)

Root File System Is Read-Only

2011-10-15 by xpheas
After a crash my Debian box mounted / read only.

To get write access simply remout the device:

BASH-Code:
1
mount -n -o remount /


Dont forget to make a file system check!

  » comments (0)

Get the domain NS glue record using dig

2011-08-29 by xpheas
First check the root servers for the tld (in my case .net)
BASH-Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ dig net NS +short
e.gtld-servers.net.
c.gtld-servers.net.
h.gtld-servers.net.
j.gtld-servers.net.
l.gtld-servers.net.
i.gtld-servers.net.
d.gtld-servers.net.
g.gtld-servers.net.
a.gtld-servers.net.
m.gtld-servers.net.
f.gtld-servers.net.
k.gtld-servers.net.
b.gtld-servers.net.

Pick one and send a query to the rootserver:
BASH-Code:
1
2
3
4
$ dig @b.gtld-servers.net tipido.net NS
;; ADDITIONAL SECTION:
ns1.tipido.com.		172800	IN	A	46.4.71.122
ns2.tipido.com.		172800	IN	A	84.23.79.58

The ADDITIONAL SECTION contains the glue records

  » comments (0)

Squid: http_port to outgoing_address

2011-08-15 by xpheas
My Squid server has 4 public IP-adresses and 4 private adresses. Each private address should map to a public one.

First add the private ones:
BASH-Code:
1
2
3
4
http_port 192.168.1.1:3128
http_port 192.168.1.2:3128
http_port 192.168.1.3:3128
http_port 192.168.1.4:3128

Now define the ACL's
BASH-Code:
1
2
3
4
acl src_01 myip 192.168.1.1
acl src_02 myip 192.168.1.2
acl src_03 myip 192.168.1.3
acl src_04 myip 192.168.1.4

And finally define the outgoing addresses:
BASH-Code:
1
2
3
4
tcp_outgoing_address 93.xx.xx.52 src_01
tcp_outgoing_address 93.xx.xx.53 src_02
tcp_outgoing_address 93.xx.xx.54 src_03
tcp_outgoing_address 93.xx.xx.55 src_04

  » comments (0)

Insall ffmpeg-php on Debian Squeeze

2011-07-28 by xpheas
I compiled PHP5.3 from the php.net sources, so there is no apt ffmpeg-php binary package available for my PHP setup and i build it myself.

First we need the ffmpeg package and some devel packages:
BASH-Code:
1
apt-get install ffmpeg libswscale0 libswscale-dev libavcodec-dev libavformat-dev

On Squeeze some needed header files are not located under /usr/local/include/ffmpeg so we need to copy them.
BASH-Code:
1
2
3
4
5
mkdir -p /usr/local/include/ffmpeg
cp /usr/include/libswscale/swscale.h /usr/local/include/ffmpeg/
cp /usr/include/libavformat/avformat.h /usr/local/include/ffmpeg/
cp /usr/include/libavformat/avio.h /usr/local/include/ffmpeg/
cp /usr/include/libavcodec/avcodec.h /usr/local/include/ffmpeg/

Now we cand download and install ffmpeg-php:
BASH-Code:
1
2
3
4
5
6
7
cd /tmp/
wget http://surfnet.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
tar xfvj ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
/usr/bin/php5-cgi/phpize
./configure --with-php-config=/usr/bin/php5-cgi/php-config
cp /tmp/ffmpeg-php-0.6.0/modules/ffmpeg.so /usr/share/php5-cgi/extensions/

To use the extension include it in your php.ini
BASH-Code:
1
extension=ffmpeg.so

or load it in your php script:
BASH-Code:
1
dl('ffmpeg.so');

  » comments (0)

Thunderbird 5 on Ubuntu Natty

2011-07-26 by xpheas
Natty comes with Tunderbird 3, Mozilla recently released Thunderbird 5. To install TB5 on Natty u can use the provided tarball from Mozilla or the PPA.
BASH-Code:
1
2
3
sudo add-apt-repository ppa:mozillateam/thunderbird-stable
sudo apt-get update
sudo apt-get upgrade

  » comments (0)

.xlsm Internet Explorer

2011-06-08 by xpheas
My "favorite Browser" doesn't download the new Office extensions (open XML file format) correctly. Internet Explorer is turning them into ZIP files.

If you use an Apache Webserver you can fix that issue by adding the following mime-types into your .htaccess

BASH-Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx

  » comments (0)

Find out the block size of an ext3/4 device

2011-05-23 by xpheas
BASH-Code:
1
tune2fs -l /dev/sda1 | grep Block

  » comments (0)

 older Posts »