Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, October 20, 2011

PGP key Check

wget http://nginx.org/download/nginx-0.8.35.tar.gz
wget http://nginx.org/download/nginx-0.8.35.tar.gz.asc
gpg nginx-0.8.35.tar.gz.asc
gpg --keyserver pgpkeys.mit.edu --recv-key

Thursday, March 31, 2011

Timezone

aptitude update tzdata
zdump -v America/Chicago | grep 2011

#epoch time 1970-01-01 00:00:00 UTC
date +%s

#epoch time of 12 Jan 2010 16:44:12 UTC
date -d "12 Jan 2010 16:44:12 UTC" +%s

#convert epoch time to readable date
date -d @371407800


//Windows
java -jar tzupdater.jar -f -bc -u

Thursday, March 24, 2011

SMB usage

smbclient '//computername/sharefolder' --workgroup=domainname --user=user
lcd /
put or get filename

Example: copy file to you windows machine

smbclient '//computername/sharefolder' --workgroup=domainname --user=user
lcd /path/to/file
put file.name

Thursday, February 10, 2011

SMTP (RFC822) testing

telnet mailhost port
EHLO
MAIL FROM: email
RCPT TO: email
DATA
Subject:
From:
To:
ENTER
message text
.

Tuesday, January 18, 2011

Regexp-Commander

From 20-04-2010
To 2010-04-20

([^0-9])([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])([^0-9])
\1\4-\3-\2\5

Friday, October 8, 2010

Helpfull UNIX stuff

Find not matches http in files
$ find -xdev -type f -name "*.cs" | while read -r; do file="${REPLY}"; grep -q
'http' "$file" || echo "File '$file' matches"; done


Find
find -xdev -type f -print0 | xargs -r0 egrep -i --files-with-matches 'jdbc\.url'

Test regular expression
egrep -i '^[A-Z]\.?

Find all processes with name java
ps -u -C java

Replace word in group of files
sed 's#oldworld#newworld#g' *.java

Friday, October 1, 2010

Random bash password generation

head /dev/urandom | uuencode -m - | sed -n 2p | cut -c1-${1:-8};

Sunday, September 20, 2009