Asterisk Blacklist Hobby webbhotell


Flytta Putty sessionen till en ny dator

Filed under: Uncategorized — Mathz @ 11:16

Kör följande kommando så får du ut dina putty sessionen i en fil på skrivbordet.

regedit /e “%userprofile%\desktop\putty-registry.reg” HKEY_CURRENT_USER\Software\Simontatham



Windows activation

Filed under: Uncategorized — Mathz @ 16:36

slui 4

slui 3

Windows Registry Editor Version 5.00





Change user serttings for documentroot on Cpanel

Filed under: Uncategorized — Mathz @ 22:25
# vim /var/cpanel/userdata/USERNAME/DOMAINNAME.COM
documentroot: /home/USERNAME/public_html/NEW_PATH

# /scripts/rebuildhttpdconf
# service httpd restart


Git init to existing folder

Filed under: Uncategorized — Mathz @ 20:48
cd ~/git/foo
git init
git remote add origin git@<host>:<git repo inkl .git>
git config --global <"Your Name">
git config --global <"Your email">
git config --global push.default simple 
git fetch origin
git branch master origin/master (optional)
git checkout master 
git add -A 
git commit -m 'first commit'
git push --set-upstream origin master 
git push


How to generate a certificate revocation list (CRL) and revoke certificates

Filed under: Uncategorized — Mathz @ 20:35

This tutorial is part of a series on being your own certificate authority, which was written for Fedora but should also work on CentOS/RHEL or any other Linux distribution.

In the first tutorial of the series, we explored how to act as a certificate authority. We also learnt how to create and sign SSL certificates.

However, an important part of being a CA is certificate revocation. Sometimes we want to revoke access for a particular client, or the certificate may even have been compromised and should no longer be trusted.

A certificate revocation list (CRL) is a list of certificates (or more specifically, a list of serial numbers for certificates) that have been revoked, and therefore, entities presenting those (revoked) certificates should no longer be trusted.


Create the CRL

Before we can generate a CRL, we must create a crlnumber file, which openssl requires to keep track of the next CRL number to use:

echo 1000 > /etc/pki/CA/crlnumber

By default, the openssl configuration file (/etc/pki/tls/openssl.cnf) uses V1 CRL lists. Uncomment the crl_extensions = crl_ext line to enable V2 CRL lists. This is probably a good idea unless you have a strong reason to stick with V1 CRL lists (eg, using an Internet browser from the Jurassic period). Now you can generate the CRL.

NB: Note that you can avoid having to specify -keyfile and -cert options by changing the private_key and certificate options in the [ CA_default ] section of your openssl configuration.

cd /etc/pki/CA
openssl ca -keyfile private/ca.key.pem -cert certs/ca.cert.pem \
    -gencrl -out crl/crl.pem

You can view the CRL with this command:

openssl crl -in /etc/pki/CA/crl/crl.pem -text

There are several other CRL options that can be used when generating your CRL list. See the CRL OPTIONS section in the ca manual page (man ca) for more information.

Create an example certificate

Currently, the CRL isn’t particularly interesting as we haven’t created or revoked any certificates yet. Let’s say that Alice is running an Apache web server and has a private folder of really cute kitten pictures. She wants to grant her friend Bob access to this collection.

Alice first needs to create and sign a cryptographic pair for Bob. This is a user certificate, so Alice is using the usr_cert extension when signing the CSR.

openssl genrsa -out /etc/pki/CA/private/bob@kittens.key.pem 4096
chmod 400 /etc/pki/CA/private/bob@kittens.key.pem
openssl req -new \
    -key /etc/pki/CA/private/bob@kittens.key.pem \
    -out /etc/pki/CA/certs/bob@kittens.csr.pem

You are about to be asked to enter information that will be incorporated
into your certificate request.
Country Name (2 letter code) [XX]:GB
State or Province Name (full name) []:London
Locality Name (eg, city) [Default City]:London
Organization Name (eg, company) [Default Company Ltd]:Alice CA
Organizational Unit Name (eg, section) []:Client Certificate
Common Name (eg, your name or your server's hostname) []:bob@kittens
Email Address []

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

cd /etc/pki/CA
openssl ca -keyfile private/ca.key.pem -cert certs/ca.cert.pem \
    -extensions usr_cert -notext -md sha1 \
    -in certs/bob@kittens.csr.pem -out certs/bob@kittens.cert.pem
chmod 444 certs/bob@kittens.cert.pem

If we look in the index.txt database, there should now be an entry for Bob’s certificate:

cat /etc/pki/CA/index.txt

V 140825183639Z   1000  unknown /C=GB/ST=London/O=Alice CA/OU=Client Certificate/CN=bob@kittens/

Revoke the example certificate

Turns out Bob wasn’t behaving. He’s been pretending that the pictures are his own and has been selling them for profit. The cheek! Let’s revoke his access immediately.

openssl ca -keyfile private/ca.key.pem -cert certs/ca.cert.pem \
    -revoke certs/bob@kittens.cert.pem

If you take another look at the index.txt database, you’ll see that the V at the start of the line has changed to an R, which means the certificate has been revoked.

cat /etc/pki/CA/index.txt

R 140825183639Z 130825184208Z 1000  unknown /C=GB/ST=London/O=Alice CA/OU=Client Certificate/CN=bob@kittens/

Note that newly created certificates are also placed in the /etc/pki/CA/newcerts directory, with a filename that matches the serial number in index.txt. For example, Bob’s certificate is also located at /etc/pki/CA/newcerts/1000.pem. When revoking certificates you can point openssl at certificates in this directory, which achieves the same thing as revoking certificates in /etc/pki/CA/certs.

Update the CRL

Now that Bob’s certificate has been revoked, we need to re-generate the CRL:

cd /etc/pki/CA
openssl ca -keyfile private/ca.key.pem -cert certs/ca.cert.pem \
    -gencrl -out crl/crl.pem

Let’s take another look at the CRL:

openssl crl -in /etc/pki/CA/crl/crl.pem -text

Certificate Revocation List (CRL):
Revoked Certificates:
    Serial Number: 1000

Using the CRL

It’s no use just having the CRL sitting in your /etc/pki/CA/crl directory. Applications need to know about your CRL.

In this particular situation, Alice can add the SSLCARevocationPath directive to her httpd.conf. This directive allows Alice to specify a directory containing her CRL files. When Bob tries to access her kitten pictures again, his client certificate has been revoked so Apache will deny him access. Thank goodness!

Similarly, OpenVPN has a crl-verify directive. This can be used to prevent clients with revoked certificates from being able to connect to the VPN.

CRL distribution point

An alternative approach to let applications know about revoked certificates is to use a CRL distribution point. Since the CRL is just a text file, it can easily be distributed by any web server. For example, Alice may keep her CRL at

Add the following to the [ usr_cert ] section of your /etc/pki/tls/openssl.cnf file:

crlDistributionPoints = URI:

Now when you sign a CSR using the usr_cert extension the CRL distribution point will be automatically added. You can check if a certificate has a CRL distribution point set by analysing the certificate:

openssl x509 -in -noout -text

        X509v3 CRL Distribution Points:

            Full Name:

Applications that support CRL distribution points will periodically download the CRL from the specified URL to check whether any certificates have been revoked.


Move an existing SVN repository

Filed under: Uncategorized — Mathz @ 08:24

How do I move an existing SVN repository?
1. On your server machine where the repository is now, run

svnadmin dump /path/to/the/svn/repo > mydumpfile

2. Put that file (mydumpfile) somewhere

3. Create a repository in new location.

4. Import the dump file (mydumpfile) by running:

svnadmin load /path/to/repo/on/ < mydumpfile


Nvidia and Ubuntu – Blank screen

Filed under: Uncategorized — Mathz @ 06:35

Remove everything to do with the Nvidia proprietary drivers.

  1. sudo nvidia-settings --uninstall
  2. sudo apt-get remove --purge nvidia*

Start from scratch.

  1. sudo apt-get remove --purge xserver-xorg-video-nouveau xserver-xorg-video-nv

Reinstall all the things!

  1. sudo apt-get install nvidia-common
  2. sudo apt-get install xserver-xorg-video-nouveau
  3. sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core

Reconfigure the X server.

  1. sudo dpkg-reconfigure xserver-xorg


Instalera libpdf i Centos

Filed under: Uncategorized — Mathz @ 11:32

cd /usr/src
tar -zxf package.tar.gz
cd package
make install


Arp problem

Filed under: Uncategorized — Tags: — Mathz @ 06:06

Bridge (kort inspelning):




Readd disk with mdadm

Filed under: Server,Uncategorized — Mathz @ 18:26

The mdadm command allows you to re-add new hard drives after one has failed. The command is simply:

mdadm - -add /dev/md* /dev/hda*

Older Posts »

Powered by WordPress