Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Category: Linux

DAS SAN NAS

Posted on February 19, 2011 - February 19, 2011 by margusja
  • DAS – Directly Attached Stprage
  • SAN – Storage area Network
  • NAS – Network Attached Storage

Posted in LinuxLeave a comment

Faster File Copy Using Tar and SSH

Posted on February 15, 2011 by margusja

tar -cf – myfile | ssh target_host “cd /target_dir; tar -xf -“

Posted in LinuxLeave a comment

ID kaardiga autentimine Apache2 veebiserveriga

Posted on February 2, 2011 - February 2, 2011 by margusja
  • Eelduseks on juba toimiv SSL sait (HTTPS)

loo eraldi kataloog /etc/httpd/conf/id/

cd /etc/httpd/conf/id/
wget http://www.sk.ee/files/JUUR-SK.PEM.cer
wget http://www.sk.ee/files/ESTEID-SK.PEM.cer
wget http://www.sk.ee/files/ESTEID-SK%202007.PEM.cer

Pane kõik 3 juursertifikaati kokku ühte faili, et veebiserveril oleks lihtsam neid lugeda:

sudo cat JUUR-SK.PEM.cer ESTEID-SK.PEM.cer ESTEID-SK\ 2007.PEM.cer > juur.crt

Lae alla kehtetute sertifikaatide nimekiri:

wget http://www.sk.ee/crls/esteid/esteid.crl
wget http://www.sk.ee/crls/esteid/esteid2007.crl
wget http://www.sk.ee/crls/juur/crl.crl

Kuna allalaetavad tühistusnimekirjad on apache jaoks loetamatul kujul, siis on vaja need konverteerida PEM formaati:

openssl crl -in esteid.crl -out esteid.crl -inform DER
openssl crl -in esteid2007.crl -out esteid2007.crl -inform DER
openssl crl -in crl.crl -out crl.crl -inform DER

Apache dokumentatsioonis nõutakse ka räsi-linkide loomist. Genereerime need käsuga:

n="0";for f in `ls *.crl`;do ln -s $f `openssl crl -hash -noout -in $f`.r$n ;let n=n+1;done

Lisa apache konfiguratsioonifaili, SSL virtuaalsaidi osasse, read:

SSLCACertificateFile /etc/httpd/conf/id/juur.crt
SSLCARevocationPath /etc/httpd/conf/id/crl

Lisa SSL virtuaalsaidi sektsioonide juurde järgmine directory sektsioon:

Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig Options
Order allow,deny
allow from all

Kataloogi, mida soovid kaitsta loo .htaccess. Juhul kui kogu virtuali soovid kaitsta, siis võib ka virtuali config faili lisada:

SSLVerifyClient require
SSLVerifyDepth 2

Kui nüüd kõik kenasti läks, siis apache restart

kui tahta, et server sertifikaatide andmed muutujatesse kannaks (et need oleks skriptides kasutatavad), võiks lisada .htaccess faili midagi sellist:


Files ~ "\.(cgi|shtml|php)$"\
SSLOptions +StdEnvVars +ExportCertData
Files

  • http://id.ee/?id=10736
  • http://wiki.itcollege.ee/index.php/ID_kaardiga_autentimine_Apache2_veebiserveriga
  • http://www.colleduc.ee/id.html
Posted in LinuxLeave a comment

memcache hints

Posted on January 20, 2011 by margusja


[21:43:31 root@arendus drupal]# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
set margusja_nimi 0 0 8
Margusja
STORED
get margusja_nimi
VALUE margusja_nimi 0 8
Margusja
END
set margusja_vanus 0 0 2
37
STORED
get margusja_nimi
VALUE margusja_nimi 0 8
Margusja
END
get margusja_vanus
VALUE margusja_vanus 0 2
37
END

Posted in LinuxLeave a comment

tcpdump hints

Posted on December 17, 2010 by margusja
  • tcpdump -s 65535 -i any port 11211 -w memcache.log
Posted in LinuxLeave a comment

Shell scripting hints

Posted on December 1, 2010 by margusja

Condition hints:

  • -b file = True if the file exists and is block special file.
  • -c file = True if the file exists and is character special file.
  • -d file = True if the file exists and is a directory.
  • -e file = True if the file exists.
  • -f file = True if the file exists and is a regular file
  • -g file = True if the file exists and the set-group-id bit is set.
  • -k file = True if the files’ “sticky” bit is set.
  • -L file = True if the file exists and is a symbolic link.
  • -p file = True if the file exists and is a named pipe.
  • -r file = True if the file exists and is readable.
  • -s file = True if the file exists and its size is greater than zero.
  • -s file = True if the file exists and is a socket.
  • -t fd = True if the file descriptor is opened on a terminal.
  • -u file = True if the file exists and its set-user-id bit is set.
  • -w file = True if the file exists and is writable.
  • -x file = True if the file exists and is executable.
  • -O file = True if the file exists and is owned by the effective user id.
  • -G file = True if the file exists and is owned by the effective group id. file1
  • –nt file2 = True if file1 is newer, by modification date, than file2. file1 ot file2 = True if file1 is older than file2. file1 ef file2 = True if file1 and file2 have the same device and inode numbers.
  • -z string = True if the length of the string is 0.
  • -n string = True if the length of the string is non-zero.
  • string1 = string2 = True if the strings are equal.
  • string1 != string2 = True if the strings are not equal.
  • !expr = True if the expr evaluates to false.
  • expr1 –a expr2 = True if both expr1 and expr2 are true.
  • expr1 –o expr2 = True is either expr1 or expr2 is true.
Posted in LinuxLeave a comment

wget hints

Posted on November 26, 2010 - November 26, 2010 by margusja
  • use wget as a crawler – wget -r -np -p -k http://www.example.com
Posted in LinuxLeave a comment

screen hints

Posted on November 17, 2010 - December 16, 2010 by margusja
  • Alusame uut sessiooni koos screeni nimetamisega – screen -S nimi
  • olemasolevad sessioonid – screen -ls
  • loobume olemasolevast aknast – CTRL+a+K
  • suleme olemasoleva sessiooni – CTRL+a+d
  • Kuvame listi olemasolevatest akentest akna alla ribale – CTRL+a+w
  • Kuvame listi olemasolevatest akentest – CTRL+a+”
  • Nimetame aktiivse akna – CTRL+a+A
  • Aktiivse akna info – CTRL+a+i
Posted in LinuxLeave a comment

Margusja testib

Posted on November 11, 2010 by margusja

test sisu

—
Tervitades, Margus (Margusja) Roo
+372 51 48 780
http://margus.roo.ee
msn: margusja@kodila.ee
skype: margusja

Posted in LinuxLeave a comment

A simple python webserver

Posted on November 4, 2010 by margusja


[Thu Nov 04 22:24:04 margusja@IRack sudo python -m SimpleHTTPServer 80
Password:
Serving HTTP on 0.0.0.0 port 80 ...
192.168.1.67 - - [04/Nov/2010 22:26:50] "GET / HTTP/1.1" 200 -
192.168.1.67 - - [04/Nov/2010 22:26:51] code 404, message File not found
192.168.1.67 - - [04/Nov/2010 22:26:51] "GET /favicon.ico HTTP/1.1" 404 -
192.168.1.67 - - [04/Nov/2010 22:27:06] "GET /Pictures/ HTTP/1.1" 200 -
192.168.1.67 - - [04/Nov/2010 22:27:09] "GET /Pictures/1hacker.jpg HTTP/1.1" 200 -
192.168.1.67 - - [04/Nov/2010 22:28:13] "GET /Pictures/icon_defaultUser.png HTTP/1.1" 200 -
192.168.1.67 - - [04/Nov/2010 22:28:18] "GET /Pictures/IMG_0001.MOV HTTP/1.1" 200 -

Posted in LinuxLeave a comment

Posts navigation

Older posts
Newer posts

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.