cribs

adding text to photos from commandline

Imagemagick is kind of stuff that everybody knows from name, but almost nobody know how to use. If you want to generate some text at your photos, change size, add watermark or whatever you want to do with picture (with no need to see this picture), or make some script that automaticaly add something to picture you have to use imagemagick :)

One of my ideas is to make a scripts which add a date to picture, like this:

montage -geometry +0+0 -background gray -label “`date`” source.jpg destination.jpg

power 6

more can be found here

Tags: ,

Sunday, June 8th, 2008 Tips, cribs No Comments

files with no valid users

Totay tip:

sometimes in some migrations, reinstall or sth, or even in backup places, you have some files owned by no valid user for current system. It is rather high security issue (in mulituser systems), so you can find every file that does not have a valid user which can be found in /etc/passwd, how?

find / -nouser > no_no_valid_user

:)

Tags:

Sunday, June 1st, 2008 Linux, Security, Tips, cribs No Comments

cribs… first some SNAT script

What is SNAT:

Process of network address translation done in a secure way (also known as source network address translation or SNAT for short). This process involves re-writing the source and/or destination addresses of IP packets as they pass through a router or firewall.

very simple bash script to SNAT to common use (with no fireworks :))

#! /bin/bash
# Marcin Rybak
#
# External IP (from WAN side)
EXTIP=”xxx.xxx.xxx.xxx”

# External iface
EXTIF=”eth0″

# Local network to SNAT”
INT_NET=”192.168.0.0/24″

# Path to IPTABLES (check if in your system is the same)
IPTABLES=”/usr/sbin/iptables”

echo “[+] Enabling ip forwarding”
echo “1″ > /proc/sys/net/ipv4/ip_forward

echo “[+] Cleaning existing tables”
$IPTABLES -t nat -F POSTROUTING
$IPTABLES -t nat -F PREROUTING
$IPTABLES -F FORWARD
$IPTABLES -P FORWARD ACCEPT

echo “[+] Turning on SNAT”
$IPTABLES -A POSTROUTING -t nat -s $INT_NET -j SNAT –to $EXTIP
echo “[+] I think it’s DONE”

Tags: , , ,

Thursday, April 10th, 2008 Linux, Tips, cribs No Comments