Gentoo Blog

The ultimate Gentoo Blog
  • Home
  • About

OpenDNS Server

Simon | November 16, 2011

Google’s Public DNS Servers in case you need a public uncensored DNS server you can use these:

8.8.8.8
8.8.4.4

Here is my resolv.conf with the open DNS servers:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 94.75.228.2
nameserver 80.237.196.2

The last two are also open DNS Servers but not from Google.

Share on Facebook
Comments
No Comments »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu 11.10 Oneiric Ocelot Get your minimize and maximize buttons back

Simon | November 15, 2011

Get your minimize and maximize buttons back:

Fire up gconf-editor, then edit the following key:

desktop > gnome > shell > windows > button_layout

Then, in the right pane, edit the button_layout value to something like

:minimize,maximize,close

Thats it your done you should now see the minimize and maximize buttons again.

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

frequently used SSL commands

Simon | October 11, 2011

generate a new private key and matching Certificate Signing Request (eg to send to a commercial CA)
openssl req -out MYCSR.csr -pubkey -new -keyout MYKEY.key

-add -nodes to create an unencrypted private key
-add -config if your config file has not been set in the environment

decrypt private key

openssl rsa -in MYKEY.key >> MYKEY-NOCRYPT.key

generate a certificate siging request for an existing private key

openssl req -out MYCSR.csr -key MYKEY.key -new

generate a certificate signing request based on an existing x509 certificate

openssl x509 -x509toreq -in MYCRT.crt -out MYCSR.csr -signkey MYKEY.key

create self-signed certificate (can be used to sign other certificates)

openssl req -x509 -new -out MYCERT.crt -keyout MYKEY.key -days 365

sign a Certificate Signing Request
openssl x509 -req -in MYCSR.csr -CA MY-CA-CERT.crt -CAkey MY-CA-KEY.key -CAcreateserial -out MYCERT.crt -days 365

-days has to be less than the validity of the CA certificate

convert DER (.crt .cer .der) to PEM

openssl x509 -inform der -in MYCERT.cer -out MYCERT.pem

convert PEM to DER

openssl x509 -outform der -in MYCERT.pem -out MYCERT.der

convert PKCS#12 (.pfx .p12) to PEM containing both private key and certificates

openssl pkcs12 -in KEYSTORE.pfx -out KEYSTORE.pem -nodes

add -nocerts for private key only; add -nokeys for certificates only

convert (add) a seperate key and certificate to a new keystore of type PKCS#12

openssl pkcs12 -export -in MYCERT.crt -inkey MYKEY.key -out KEYSTORE.p12 -name "tomcat"
check a private key

openssl rsa -in MYKEY.key -check

add -noout to not disclose the key

check a Certificate Signing Request

openssl req -text -noout -verify -in MYCSR.csr

check a certificate

openssl x509 -in MYCERT.crt -text -noout
check a PKCS#12 keystore

openssl pkcs12 -info -in KEYSTORE.p12

check a trust chain of a certificate

openssl verify -CAfile MYCHAINFILE.pem -verbose MYCERT.crt

-to check for server usage: -purpose sslserver
-to check for client usage: -purpose sslient

Share on Facebook
Comments
No Comments »
Categories
confixx/Plesk, Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Mount a Linux NFS Share on Windows 7

Simon | August 2, 2011

First you need to install the windows nfs client. Go to

Control Panel\All Control Panel Items\Programs and Features

Then click on Turn Windows features on or off then select NFS Services Client for NFS. After the installation start a dos box or power shell. And enter the following command to mount the share backup on server 192.168.1.1 and assign the drive letter k:

mount \\192.168.1.1\backup k:

Example: mount [options] \\nfs-server-unc-name\share-name [drive letter]

Share on Facebook
Comments
No Comments »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Extracting a Database From a mysqldump File

Simon | August 2, 2011

Restoring a single database from a full dump is pretty easy, using the mysql command line client’s –one-database option:

mysql -u root -p --one-database db_to_restore < fulldump.sql

But what if you don’t want to restore the database, you just want to extract it out of the dump file? Well, that happens to be easy as well, thanks to the magic of sed:

sed -n '/^-- Current Database: `test`/,/^-- Current Database: `/p' fulldump.sql > test.sql

You just need to change “test” to be the name of the database you want extracted. Or you can use this shell script:

Download mysqldumpsplitter

Usage:

$>sh MyDumpSplitter.sh
Usage: sh MyDumpSplitter.sh DUMP-FILE-NAME — Extract all tables as a separate file from dump.
sh MyDumpSplitter.sh DUMP-FILE-NAME TABLE-NAME — Extract single table from dump.
sh MyDumpSplitter.sh DUMP-FILE-NAME -S TABLE-NAME-REGEXP – Extract tables from dump for specified regular expression.

Further instructions for using this script can be found here:

Mysql dump-shell script

Share on Facebook
Comments
No Comments »
Categories
Gentoo, mysql, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Mirror a website with wget

Simon | July 11, 2011

To copy or mirror a website with wget do the following:

wget -r -l2 -N -k -x mywebsite.com

This will create a complete copy of the website into a folder called mywebsite.com.

Have fun

Share on Facebook
Comments
No Comments »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Unity keyboard and mouse shortcuts

Simon | June 12, 2011

 

 

 

 

 

 

 

 

 

 

 


 
Wallpaper download

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Upgrading Debian Lenny to Squeeze

Simon | April 14, 2011

Upgrade to Debian Squeeze if you have some Linux experience this upgrade should be fairly straight forward. Please read everything and do not skip steps unless you know what you are doing. You may be left with a system that will not boot. Please also consult the official Debian upgrade guide if you run into any problems or conflicts:


Debian upgrade guide


Create a list of installed packages and check the list for deinstalled packages this is an optional step to make sure you have a clean system:

uninstall=$(dpkg --get-selections > /root/package.list.lenny ; cat /root/package.list.lenny | grep deinstall |awk {'print $'1}) ; aptitude purge $uninstall

Check for half installed packages:

dpkg --audit

Remove Backuports and APT Pinnings Check for non debian sources and change them to the squeeze repo if available

Replace lenny entries with squeeze replace volitile with squeeze-updates:

Also make sure to add non-free and contrib in case your server needs the firmware-linux-nonfree package. This is a example sources list for squeeze if you live in Germany:

############################################################
deb http://ftp.hosteurope.de/pub/linux/debian/ squeeze main contrib non-free
deb-src http://ftp.hosteurope.de/pub/linux/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://ftp.hosteurope.de/pub/linux/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.hosteurope.de/pub/linux/debian/ squeeze-updates main contrib non-free
#############################################################

Update sources:

apt-get update

Check to see if you have sufficient disk space:

apt-get -o APT::Get::Trivial-Only=true dist-upgrade

Preform a minimal System Upgrade:

apt-get upgrade

Install the new kernel important otherwise your system may not boot because of the new udev version choose your kernel:

apt-get install linux-image-2.6-amd64

This would install the 64bit Debian Kernel

Check the Kernel Install:

dpkg -l "linux-image*" | grep ^ii

Upgrade udev:

apt-get install udev

If you see any firmware warnings make sure to install the firmware-linux-nonfree or the firmware-linux package before you reboot:

apt-get install firmware-linux-nonfree

or

apt-get install firmware-linux

Preform a system Upgrade or full upgrade:

apt-get dist-upgrade

Change init scripts to inssrv this is normally done automatically:

dpkg-reconfigure sysv-rc

Reboot the system

After first reboot Install Grub 2 to MBR:

upgrade-from-grub-legacy

rm -f /boot/grub/menu.lst*

Clean up and remove downloaded packages removing the downloaded packages is a optional step:

apt-get autoremove

rm -f /var/cache/apt/archives/*.deb

This step is also optional remove obsolete packages with deborphan helps to keep your system clean:

install deborphan:

apt-get install deborphan

Use deborphan to remove obsolete packages check the list first:

deborphan --guess-all

Then remove the obsolete packages:

deborphan --guess-all | xargs aptitude -y purge

Thats it you should have a clean system running Debian Squeeze

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu / Debian Linux Regenerate SSH Host Keys

Simon | March 25, 2011

If you need to regenerate your SSH Host Keys do the following.

1. delete your old keys

rm /etc/ssh/ssh_host_*

2. reconfigure the ssh server

dpkg-reconfigure openssh-server

That’s it now you can update you known_hosts file when you connect next time. If you use strict checking which you should you will need to delete the key from you known_hosts file in you home directory. Or you will not be able to connect.

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Tags
SSH Debian Host Keys, Ubuntu
Comments rss Comments rss
Trackback Trackback

Openssl Create a Private Key and a CSR with 2048bit for an SSL Certificate

Simon | February 17, 2011

If you need a new SSL certificate for a server you will need a 2048bit private key from 2011 onwards. This command creates both:

openssl req -new -nodes -newkey rsa:2048 -keyout example.key -out example.csr

Thats it send the CSR to you ISP and you should get you SSL cert back. You can also edit:

/etc/ssl/openssl.cnf

And change the default_bits line to 2048 then all new keys we be created with 2048bits.

Share on Facebook
Comments
1 Comment »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

« Previous Entries

 

February 2012
M T W T F S S
« Dec    
 12345
6789101112
13141516171819
20212223242526
272829  

Categories

  • confixx/Plesk
  • fun
  • Gentoo
  • iptables
  • mysql
  • news
  • Raid Controllers
  • Stuff
  • Ubuntu/Debian
  • Xen/Vmware

Links

  • Gentoo
  • http.net
  • iphone software linux
  • michael-fuchs.net
  • Ubuntu
  • webupd8.org

Search Blog

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox