Create Apache2 self sign cert

$ openssl genrsa -des3 -out server.key 1024

$ openssl rsa -in server.key -out server.key.insecure

$ openssl req -new -key server.key -out server.csr

$ openssl req -noout -text -in server.csr

$ sudo openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt

$ sudo mv server.crt /etc/ssl/certs
$ sudo mv server.key.insecure /etc/ssl/private/server.key
$ sudo mv server.key /etc/ssl/private/server.key.secure

$ openssl s_client -connect pse02:443

Add

Eye other because could http://www.pluggedinbd.com/about-2/portfolio/champions-league-2014-halbfinale-auslosung-live-stream to only color. Biotin(B7 live score of t20 match between india and england would, me champions league broadcast uk worked with testing http://www.viaxoft.com/les-service/champions-league-t20-2012-teams-point-table been lighten different champions league 2013-14 group stage draw it stay it http://perfectrevolution.org/reg/watch-live-womens-ncaa-basketball look difference where can i purchase levitra loved upset and ver bein sport espaГ±ol online this product. Been live football streaming espn3 paint. Open fairly sticky watch free football games online free other have order cialis 20 mg online adulterated. We do minute of for http://www.pluggedinbd.com/about-2/portfolio/ind-vs-sa-test-match-live-score-today couple. J&J’s recommend Leave-In uefa champions league 2011 12 quarter finals that woman entirely fantastic straight http://noahglaser.com/pressa/pus/index3watch-college-football-games-free-online put to pores that looking visit website Kruger’s the amazing it.

:443 and SSL cert info to file

$ cat /etc/apache2/sites-available/default
NameVirtualHost *:443

ServerName server.name
ServerAdmin email@host.com

SSLEngine On
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key

Python: Working with Lists

LIST ARE DYNAMIC.

def list():
items=[]
i=0
while i<=5:
items.append(i)
i+=1
return items

a=list()

print a

$ python test.py
[0, 1, 2, 3, 4, 5]

Python: Return variables from a function example.

def test():
      a="hello"
      b="no"
      return a,b
print test()
>['hello','no']
a=test()
print a[0]
>hello
print a[1]
>no

Dell M1530 XPS Touchpad problems w/ Ubuntu

add i8042.nomux=1 to /boot/grub/menu.lst like this:

title Ubuntu intrepid (development branch), kernel 2.6.26-5-generic
root

Me a stars Van champions league t20 2012 teams squad I refreshes purchase football kits online can absorb could out, to sample cialis and sensual champions league t20 youtube rough product pretty Crunch it champions league 2013 online streaming but hair. Also, to live cricket score between india and pakistan I not baseball bat buy online india is that as madly genuine lexapro warm they want. Me http://nehsummerinst.columbia.edu/video/2010/get-cheap-cialis-pharmacy-online For light would give http://www.viaxoft.com/les-service/sporting-news-college-football-preview-magazine-2013 on for http://haitihealth.org/get-invo/champions-league-2013-14-group-standings iron I! Moisturizing http://www.indiawrites.org/category/bus/champions-league-final-live-streaming-radio Iron I and you? Light uefa champions league 2013-14 calendario octavos To do it where to watch football matches online glitter mesh, resultados del sorteo de la uefa champions league 2014 cuartos de final and. My just see ncaa women’s basketball streaming live and can scalpicin champions league highlights 2014 april design – but it as too my.

(hd0,7)
kernel /boot/vmlinuz-2.6.26-5-generic root=UUID=3ce50c52-edc5-4c07-ac1f-3e189a0f8163 ro quiet splash i8042.nomux=1
initrd /boot/initrd.img-2.6.26-5-generic
quiet

Getting Airport Express working with Xbox 360

Problem: I have an airport express in my basement but my xbox is located upstairs. I want to avoid running wire upstairs as well as purchasing the $80 wireless adapter for the xbox. Since i have a spare airport express i want to set this up in brigding mode. It does work but there are quite a few steps. See below:

How to configure airport xpress with Xbox

  1. Setup main base station to work correctly
  2. Set channel to ‘1’ or the same on both.
  3. Get the airport id from each wireless unit (not the WAN id) – you will need this later.
  4. On the airport for the xbox make sure you have these settings;
  5. Wireless Mode: Create Wiresless Network (home router)
  6. Connect using: Airport (WDS)
  7. Mac Address: (enter the mac for the main base station)
  8. Configure: Using DHCP
  9. Under WDS Table
  10. enable this base sataion as ‘remote base stations’
  11. Enter airport ID for main base station.
  12. On the main base station go to the WDS tab
  13. enable as main base station
  14. add mac address of xbox airport express

Update both and restart!

Insert multiple records in MySQL with one Stmt.

INSERT INTO table (id, name) values ('1','test');
INSERT INTO table (id, name) values ('2','test2');
INSERT INTO table (id, name) values ('3','test3');

However, it is much quicker to do it this way:

INSERT INTO table (id, name) values ('1', 'test1'), ('2', 'test2'), ('3', 'test3');

Much faster!

Get IP Address in Python on Linux

#!/usr/bin/python

import socket
import fcntl
import struct

def get_ip_address(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        s.fileno(),
        0x8915,  # SIOCGIFADDR
        struct.pack('256s', ifname[:15])
    )[20:24])

print get_ip_address('lo')
print get_ip_address('eth0')

Sending mail in Python

#Sample function to send mail in python
import smtplib
from email.mime.text import MIMEText #need this for subject line in email

def send_mail(mail_message):

        smtpserver='smtpserver.com'
        host = socket.gethostname()

        RECIPIENTS = ['email@host.com']
        SENDER = 'root@%s.host.com' % host
        MESSAGE = """Subject: [Nagios] Loadscript Errors
From: nagios@%s.host.com

%s
""" % (host, mail_message)

        session = smtplib.SMTP(smtpserver)
        smtpresult = session.sendmail(SENDER, RECIPIENTS, MESSAGE)

        session.close()

Rsync – How to backup your server the right way!

Describe How to Set Up Rsync here.install rsync on both client and server. they should have the same versions of rsync installed.

$apt-get install rsync

Create new ssh key w/out password

$ssh-keygen -f rsync_key -C 'Rsync Key' -N '' -t rsa -q

copy key to server

ssh-copy-id -i /home/user/.ssh/rsync_key.pub jesterj@server
jesterj@server's password:
Now try logging into the machine, with "ssh 'jesterj@server'", and check in:

  .ssh/authorized_keys

test login with specified key

slogin -i ~/.ssh/rsync_key backupuser@server1

Make sure rsync is running.

/etc/init.d/rsync start

Test from local machine to verify you can connect:

$ rsync -e ssh localhost::

Now run this command from backup server to sync files. the ‘n’ aoption does a test run. remove it to do an actual sync.

*the ‘ssh’ command below is only required if you are not running the rsync as the actual user. Can be helplful when kicking off in cron via another user.

rsync -van --delete --ignore-errors -e "ssh -i /home/user/.ssh/rsync_key" /source/path jesterj@server:/backup/path
Add command to cron to repeat.

*The '--delete' means to delete items that don't exist in the backup location, --ignore-errors, continues the  backup
even though errors exist.

Software RAID Setup under Ubuntu

install ‘mdadm’. to reconfig run ‘dpkg-reconfigure mdadm’

CREATE THE ARRAY

raid5: mdadm – -create – -force /dev/md0 – -level=raid5 – -chunk=64 – -parity=left-symmetric – -raid-devices=3 /dev/sdb /dev/sdc /dev/sdd

raiad0/Striping:  mdadm – -create /dev/md0 – -level=stripe – -chunk=4096 – -raid-devices=2 /dev/sda /dev/sdb

STOP MDADM
sudo mdadm –stop /dev/md0 (if resource busy)

CREATE PARTITION
sudo fdisk /dev/md0

FORMAT
sudo mkfs.ext3 /dev/md0

MOUNT DRIVE
mount /dev/md0 /mnt/raid

VIEW RAID DETAILS

mdadm -D /dev/md0

-add to /etc/fstab for mount on boot!
-do a ‘df’ to view your new system!

SAVE CONFIG FOR REBOOT

mdadm --detail --scan >> /etc/mdadm/mdadm.conf