Restrict RoundCube login username to one domain

Restrict RoundCube login username to one domain

Roundcube is a client software to access IMAP mailboxes. If you already came to this post, then I’m sure you’ve figured out that RoundCube does not restrict domains in the login form, which means that as long as your username and password are OK, you can basically use any domain you like in your username field. Exc: @gmail.com, @yahoo.com etc.

This is not something that Roundcube deals with, because it should be taken care of on your IMAP server configuration, and if the IMAP server does not check for your full username (domain included), and allows access with any other domain, you get access :). However, even if it’s taken care of on your IMAP server, handling this in RoundCube will prevent an unnecessary request to your IMAP server.

One of the configuration options in Roundcube helps you append the domain to a clean username login.
Exc: if in your username field you type only the username “username” without the “@domain.com” then roundcube can help  you by appending the “@domain.com”. This is helpful only for IMAP servers that require full e-mail addresses for login. You can specify this by editing $rcmail_config[‘username_domain’] variable in config/defaults.inc.php

By default that variable is blank as below:

$config['username_domain'] = '';

Above that variable, you’ll find a short description on what options can be set to this variable, one of which you might assume it is:

%d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)

But in cases when your roundcube installation is in a different host/domain server than your original domain that is needed to authenticate in your IMAP server, that will not help, therefore use your domain as follows:

$config['username_domain'] = 'yourdomain.com';

Now if you type “username” (without the domain) in the username field, roundcube will append “@yourdomain.com” and the request to your IMAP server will have your username sent as “username@yourdomain.com”, otherwise if you already specify the domain in your username field, it will make the login request with the specified domain which in this case can be anything (@gmail.com, @yahoo.com etc). Continue reading “Restrict RoundCube login username to one domain”

/dev/mapper/cryptswap1 is not ready yet or not present

I had this error going for a long time now (usually while my system was loading from a reboot) and my swap space would usually just not work…
I finally had some time to deal with that.
I couldnt even reformat it in gparted or something similar…

This is how I fixed it:

First you turn your swap space off

$ sudo swapoff -a

commented out the existing swap line in /etc/crypttab

comment out the swap line in /etc/fstab

# /dev/mapper/cryptswap1 none swap sw 0 0

reboot your pc/laptop

now you should be working without a swap space, try reformatting your partition in gparted to a linux-swap type (in my case it was /dev/sda3)

after successfully reformatting it, proceed this way: Continue reading “/dev/mapper/cryptswap1 is not ready yet or not present”

Conky configuration

Conky is free software (a desktop widget) which runs in X on Linux and BSD. Originally a fork of Torsmo, Conky’s torsmo-based code is BSD licensed. New code in Conky has been licensed under the GPL 3.0.

Since its inception, Conky has changed significantly from its predecessor, while maintaining simplicity and configurability. Conky can display just about anything, either on your root desktop or in its own window. Not only does Conky have many built-in objects, it can also display just about any piece of information by using scripts and other external programs.

Lately I was configuring/designing/modifying a Conky configuration and I decided to share it with others.

SETUP

Go to github repository and get the Conky config files: https://github.com/altinukshini/conky_blue

Note: If your battery is not showing than you are probabbly using another format exc (BAT1 or BAT2) instead of BAT0 which is the default one.
To fix this issue change line 65 in conkyrc file:

from: ${battery_percent}%
to: ${battery_percent BAT1}%

To call this script in Conky, use the following in your conkyrc:

lua_load ~/.fluxbox/conky/conky_blue/clock_rings.lua
lua_draw_hook_pre clock_rings

Because I have used this conky configuration with fluxbox I have put it under .fluxbox folder on my home directory. Continue reading “Conky configuration”

Getting started with PhoneGap for Android

First of all a short description of what’s phonegap:
PhoneGap is an open source implementation of open standards. That means developers and companies can use PhoneGap for mobile applications that are free, commercial, open source, or any combination of these.
PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies developers already know best… HTML and JavaScript.

During this blog I’ll be showing mostly the main things you should be knowing when you start working with PhoneGap.
So what I’ll be talking about will be:

  • Importing some of the libraries that you will need…
  • How to make your application go Full Screen in Phonegap
  • How to add a Splash Screen and give it a (delay time)
  • How to create a basic menu with quit and reload function.
  • How to change the application icon instead of the default android one.
  • Where to put some specific lines for the code to work properly.
  • Make app compatible with older versions of Android.

OK, first of all you have to set up your environment for android developement as you have to follow the guide provided from phonegap here. Continue reading “Getting started with PhoneGap for Android”

How to install NVIDIA Drivers in Ubuntu Linux

Probably you have tried to install NVIDIA graphics driver for Ubuntu or Linux in general so many times just like me, but never found a way how to do that properly.

Well in Ubuntu you have some 2 types of NVIDIA driver which you can find them in Additional Drivers (third party proprietary drivers) :
1. The Version 173 – which is crap especially because its very slow & laggy.
2. Recommended one – which has bugs on KDE and usually in some cases results with crashing entire OS, sometimes when trying to resize konsole in KDE. (at least that’s what happened with me)

To start with:

Ubuntu has an enabled Kernel Nouveau by default, this is what makes the NVIDIA driver always crash during installation.
So to install the drivers ofcourse you need to disable that so that you can proceed. Continue reading “How to install NVIDIA Drivers in Ubuntu Linux”

Database backup scripts

1. Database backup bash script
2. Perl email script
3. Cron job configuration to run the script

Here are some scripts that will help you make a database backup and than
another script that will send you an email, to confirm that the backup was made and probably if you want you can make the script send you the backup attached via email…
Then finally a cron configuration to run the database backup script everyday, week, month or once a year.

So here is the step by step tutorial…

First Lets make some directories..

1. Make a directory in /var/backups/ called sqlbackup

mkdir /var/backups/sqlbackup

Continue reading “Database backup scripts”