Posts

Showing posts with the label linux

Openstack user admin commands removed from nova-manage

Lately I have been trying to get an openstack node up and running on an Ubuntu VM. For which, I was following a couple of the many guides available online. Everything went well until I found out that I was not able to create a user with an admin role using the nova-manage command. I was trying to run, nova-manage user admin openstack Much to my disappointment, I got the following error,  nova-manage: error: argument category: invalid choice: 'user' (choose from 'version', 'bash-completion', 'project', 'account', 'shell', 'logs', 'service', 'db', 'vm', 'agent', 'cell', 'instance_type', 'host', 'flavor', 'fixed', 'vpn', 'floating', 'network') I was a bit frustrated after going through the wiki for the nova-manage command which said that nova-manage was going away in the Folsom release of openstack, but never said anything about what is go...

Login remotely to a ADS authenticated RHEL system

This week I was trying to get an RHEL system to authenticate me using my Active Directory credentials. After a bit of looking around, I cam across this wonderful step-by-step procedure to get it done: Attaching a RHEL6 server install to Active Directory for authentication Everything was going on well. I was able to do a local login using: ssh myuser@MYDOMAIN@localhost I just thought it might be cool to try logging in to my newly configured ADS authenticated box over SSH from another machine. So I tried, ssh myuser@MYDOMAIN@192.168.0.1 which obviously didn't work. The shell was treating "MYDOMAIN@192.168.0.1" as the hostname. With a little bit of playing around I found out that the following worked: ssh "MYDOMAIN\myuser"@192.168.0.1 It looks like specifying the domain the way usually Windows expects it really did work if it was enclosed in quotes!

500 Internal Server error with codeigniter mysql connection

I was trying out CodeIgniter  today. I found it quite lightweight and easy to get started with. MVC was fine until I came across a strange issue. Every time I tried to connect to the database, I would end up getting the infamous "500 Internal server error". Unfortunately, even after checking through all http logs, I was not able to trace it to anything that could've gone wrong. I had apache, php, mysql installed and configured correctly. Spent about 4 hours trying out different configurations, playing around with the database names, model names, etc, just to realise later that I did not have the php-mysql driver installed! This time I was on an ubuntu machine, so I had to: apt-get install php5-mysql and then although I could see that apt-get had already restarted apache2 for me, I just thought of doing it myself as well, service apache2 restart and there it was. Everything was working the way I wanted it to be. It was a very silly thing to miss out on this one. I have don...

Accents in Windows 8 on a Mac

Having been used to the Compose Key in Linux, I was trying to find out a way to type Portuguese (accented) characters in Windows 8 installed on a Macbook Pro. After reading up about the Dead key and use of AltGr key, I started experimenting with different key combinations. My keyboard layout was set to US (English). While playing around with different keys, I just found out that you could use the left "control" key in almost the same way as you would use the "Compose Key" on Linux. For example,   <Ctrl>` a  gives you,   à  While using the control key, do mind the fact that in many instances, "CTRL"+<some aplhabet> are bound to some default actions, like <CTRL>+o opens a new file, etc. Well, that seems to work well only in the address bar of Chrome. So, next I figured that you can actually use others keys as well instead of just the <Ctrl> key if you change your keyboard layout to US-International Keyboard layout. <Alt> + ...

Moving a storage pool in Virt Manager/Qemu

Today, I had to move my storage pool in Qemu to some other partition due to low disk space on my root partition. I decided to move it to a directory in my /home partition (I'm used to allocating most of my disk space to the /home partition). First of all, we need to stop libvirtd. /sbin/service libvirtd stop Next, we should move the storage pool to the new location. By default the storage pool is located at /var/lib/libvirt/images . I choose to move it to the directory /home/ausmarton/vm . mv /var/lib/libvirt/images /home/ausmarton/vm Any storage pool that is configured, has an xml file created for itself in /etc/libvirt/storage . So, in our case, we just need to edit the file /etc/libvirt/storage/default.xml . Here, we need to edit the path element which comes under the target element. <path>/var/lib/libvirt/images</path> Now that line should look something like this: <path>/home/ausmarton/vm</path> I would like to point out that /etc/libvirt/storage/ a...

Errors while trying to monitor Asterisk through Nagios

Today, I was trying to configure nagios to monitor an asterisk setup. I installed the nagios-plugins-check_sip plugin available for CentOS. I also had check_asterisk downloaded from here just to try out both. Now, check_asterisk and check_sip are perl scipts which can be used to monitor an asterisk setup. When run through the command line, they seem to work fine, i.e: given that asterisk or any other sip server is listening and your command is correct, you should get output similar to this: ;SIP/2.0 200 OK, 0.000585 seconds response time, cnt=1 Although, that's exactly what I got, it didn't work the same way through nagios, I was getting the following as the output from the plugin. (Service check did not exit properly) After enabling debug info for nagios, I found this in the logs, HOST: remotehost, SERVICE: Asterisk, CHECK TYPE: Active, OPTIONS: 1, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: No, RETURN CODE: 3, OUTPUT: **ePN failed to compile /usr/lib64/nagios/plugins/chec...

Allow ssh access to multiple users on GoDaddy's shared hosting without sharing your password

My aim was to allow a couple of colleagues to ssh into my shared hosting server at GoDaddy. If it was any other server, I could have very well created another user which could be used by anyone else who needs access to the server. But, on GoDaddy shared hosting servers you get just one ssh user, hence this blog entry. As described in Max Beatty's  blog , its a very simple job. But my approach was a little different, I did not want to keep copying everyone's public key into my godaddy server's .ssh/authorized_keys2 file. Instead of that, I created a new public/private key pair [ausmarton@ausmarton ~]$ ssh-keygen Next, step which is similar to Max's approach is to copy the newly generated public key onto our server. [ausmarton@ausmarton ~]$ scp ~/.ssh/id_rsa.pub user@remote-host:.ssh/authorized_keys2 If you're on a linux system, you can use ssh-copy-id, which does it quite neatly. [ausmarton@ausmarton ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host Now, you just need...

Vnc server on a different port

The vncserver script seems to contain most of the configuration for the vnc server. In order to start vnc on an arbitrary port number, I started looking around in /etc, for any configuration relating to vnc. But I could not find anything there. As I was looking through the script /usr/bin/vncviewer, I found that the port number was derived using the display number which was given as a parameter at line 125 of that file. $vncPort = 5900 + $displayNumber; The only advantage of doing this is that you can start multiple instances of vncserver on one machine without having them fight for a single port number. If you need to start the vncserver always on port number 5900, you can change the line to something like this: $vncPort = 5900; Obviously, if you do this, it then becomes your responsibility to make sure no other instance of vncserver or any other service is running on port 5900.

Drag lag or drag delay in Fedora 17

I just installed Fedora 17 on my laptop. After doing that I noticed that I was not about to click and drag stuff. Experimenting with it a little more, I figured that "dragging" would work only if I hold the first click for a few seconds, i.e: if I want to drag something around, I had to click and wait for the click to register and then I could drag. This was a pain since you cannot select text, navigate maps (Google Maps), resize or move windows etc. The solution was a pretty trivial one though. After a bit of looking around, I came across the mouse and touchpad configuration tool in Gnome. There is a slider for configuring the threshold of the drag and drop. Larger threshold would mean you need to hold the initial click for a shorter duration while smaller threshold would lead to a more prominent drag lag/delay. An important thing to note would be that this won't work until you restart the X server. So, either log out and log in or restart your system.