highball.se

Out of clutter, find simplicity

Archive for the ‘Linux’ Category

Enforce HTTPS with a .htaccess file

Start by enabling mod_rewrite then create an .htaccess file in the directory that you want to force HTTPS. The content of the .htaccess-file: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} somefolder RewriteRule ^(.*)$ https://www.domain.com/somefolder/$1 [R,L] Now if you go to http://www.domain.com/somefolder you will be redirected to https://www.domain.com/somefolder.

Logging my work to a text file and making it readable in VIM

I use VIM to edit text-files on my mac. Or I use VIM to edit a couple of text-files containing my my worklogs. So I can keep track of what I have done on different projects and at what time. Creating a quick log entry I have edited my .bash_profile with the following line alias [...]

Linked: Bash reference

Found this awesome bash reference here and thought I’d share it. Ctrl + A Go to the beginning of the line you are currently typing on Ctrl + E Go to the end of the line you are currently typing on Ctrl + L Clears the Screen, similar to the clear command Ctrl + U [...]

Linked: GParted 0.8 can recover data from lost partitions

GParted is an extremely handy LiveCD to keep in your technician’s toolbox, and its new version features one very major addition: GParted 0.8 can now help you recover data from lost partitions. After analyzing your drive and doing its best to resurrect missing information from the partition table, GParted will now let you mount partitions [...]

Linked: Delete Files Older Than x Days on Linux – How-To Geek

Great post on how to delete files older than x days on linux. The How-To Geek is awesome, as usual! Command Syntax findĀ /path/to/files* -mtime +5 -exec rm {} \; Note that thereĀ are spaces between rm, {}, and \; Explanation The first argument is the path to the files. This can be a path, a directory, [...]

A Guide to Efficiently Using Irssi and Screen | quadpoint.org

Irssi is a text-only IRC client. It does not get in your way and its commands are intuitive and useful. Non-standard features are implemented with perl scripts, rather than in the core. Irssi can range from a functional, no-frills client to a highly-customized and automated client. Irssi is not the only focus of this guide. [...]

Problem with mysql after Ubuntu 10.04 upgrade and reboot

I just upgraded one of my ubuntu servers and rebooted it. After the reboot the mysql daemon did now start. I turned out that the file /etc/mysql/my.cnf had disappeared somehow. I had to do the following to fix it: I found the solution here.