Monthly Archives: May 2013

Create div with rounded borders and gradient

To create a HTML DIV with rounded borders and a gradient background use the folowing CSS style:

On http://css3pie.com/ you can generate different CSS styles with this kind of “boxes”.

Share

WordPress Optimization

Edit your .htaccess file and add the line

To optimize your WordPress installation add the following to your theme (not the WordPress) Functions.php at the very top:

Line 1 will remove the WordPress identifier

Line 2 will remove the Windows Live Writer support for downloading css

Line 3 will remove

Line 4 and 5 will remove the secondary WordPress feeds

 

WordPress keeps track of your post revisions. To disable this feature place the following line in your wp-config.php

To keep at most three revisions use

 

Share

Install sublime text 2 package control

Install sublime text 2 package control to easily download and install plugins for the sublime text editor. First open up the console window: view -> show console.

Then past the following command into the console and press enter:

For Sublime Text 3

 

 

Restart sublime and show the command pallet with Ctrl+ Shift + P. Type “package contol” and select “install package”. A list of installable packages will show up. Choose your packages for installation.

If you are behind a proxy you should add it to your Sublime settings. Goto Preferences -> Settings User and add the following line (add a ‘,’ to the line above if needed):

Share

tar and untar

Create archive

  • -z: Compress archive using gzip program
  • -c: Create archive
  • -v: Verbose i.e display progress while creating archive
  • -f: Archive File name

 

Untar archive

  • -x: Extract files

 

List content of archive

 

Share

mysql backup and restore

Howto backup and restore your MySQL databases

Backup

Restore

 

 

Share

mount webdav folder

To mount a webdav folder (for example your box.com drive) use the following command:
mount -tdavfs https://www.box.com/dav/ /mnt/box/
Type username and password when asked and voila; your box.com drive is available!

You could also add your username and password to the /etc/davfs2/secrets file and they
will be used by the mount command.

Share

perl locale warning

When execute, for example, the perl command the message below could be shown:

To get rid of this message compile the language locale as shown at “LC_NAME=” text. Compile the nl_NL.UTF-8 locale:

If the message persists check that all locale related environment variables have a valid value (ie they are not (unset)).

locale-gen nl_NL.UTF-8

perl

Share

Ubuntu Apache + MySQL + WordPress

Install devenv with Ubuntu + Apache + MySQL

Create a new virtual machine and mount your Ubuntu ISO as CDROM drive. Startup the new virtual machine and install Ubuntu with default options.

After Ubuntu installation is complete be sure to add the guest additions to your system (keep your original configuration when asked):

Ubuntu windows appearing slow? See this url: http://askubuntu.com/questions/207813/why-does-an-ubuntu-12-10-guest-in-virtualbox-run-very-very-slowly/214968#214968

Upgrade and update your system to make sure you have the latest and the greatest software:

Mandatory components for your development environment

Optional (but useful tools)

WebMin server administration

When you want to mount an external CIFS filesystem (for example your NAS) install the CIFS utility package.

Mount a cifs remote file system:

Setup WordPress installatie

For pretty URL’s to work make sure the rewrite module is enabled in Apache. You can do this with the WebMin tool; in Webmin goto “Servers”, “Apache Webserver”, select the “Global configuration” tab, select “Configure Apache modules”, check the “Rewrite” module.

Changes take effect immediately.

Setup the MySQL database

Share

SSH OpenSSH Keys

Generating RSA Keys
The first step involves creating a set of RSA keys for use in authentication.
This should be done on the client.
To create your public and private SSH keys on the command-line:

Default the private key is stored in a file called id_rsa  and the public key is stored in a file called id_rsa.pub . It is the pub key that you send to other servers!

Transfer Client public key to Host
The key you need to transfer to the host is the public one. If you can log in to a computer over SSH using a password, you can transfer your RSA key by doing the following from your own computer:

Log in to your host
Log in to your host as usual; you should be prompted for your passphrase. After that the next connection will be made based on your private key.

If the host is configure to only use public key authentication then you have to disable this for a while (or copy the key via another account to the server).

To temporarily disable public key authentication edit your /etc/ssh/sshd_config  file and set the value for passwordauthentication  to yes .

Execute the ssh-copy-id and reset the passwordauthentication value in your sshd_config.

Troubleshooting

When no connection could be made check the ssh log at

When you encounter something like

Try changing your home folder permissions:

Share