Who’s there? – Invalid ssh user

So, It’s been a while since I’ve set up my home server to use it as a swiss army knife at home and on the road.
Now I was wondering on the system’s integrity.
First step was checking /var/log/auth.log
To do some quick’n’dirty check I’ve ran the following command

grep “Invalid user” /var/log/auth.log | less

Continue reading Who’s there? – Invalid ssh user

New items on my wishlist

Thanks to Zhann, whom pointed out to these 2 fine books, my wishlist got (even) longer.

1. Time management

This collection of time management tools addresses the very specific needs of embattled system administrators everywhere. Bestselling author Thomas Limoncelli shows you how to manage interruptions, eliminate timewasters, prioritize based on customer expectations, automate processes for faster execution, and much more. It’s the first step to a more productive, happier you.

Time management

2. UNIX and Linux System Administration Handbook!

This twentieth anniversary edition of the world’s best-selling UNIX system administration book has been made even better by adding coverage of the leading Linux distributions: Ubuntu, openSUSE, and Red Hat Enterprise Linux.

This book approaches system administration from a practical perspective and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, software configuration management, performance analysis, Windows interoperability, virtualization, DNS, security, management of IT service organizations, and much more.

UNIX and Linux System Administration Handbook!

So, mom if you read this and you’d like to surprise me with something… This is it!!! You know I love you! 😉

Twirssi error: Timestamp out of bounds

I just found my twirssi inactive. 
When loading the script and authenticating with oath enabled, I got the error:

-!- Irssi: Error in script twirssi:
Timestamp out of bounds

This is (most likely) the result of a wrong system date/time.
Quite easy to solve, just sync it to an NTP server.
Open a terminal and enter:

ntpdate pool.ntp.org

Try to load the script again and login.
All should be fine now.

Wrong time in Windows on Dual Boot system.

When you have a dual boot with Windows and Ubuntu you might experience some time travelling when rebooting to windows.
To solve this, simply boot into Ubuntu and edit the /etc/default/rcS file as sudo and change the UTC value from yes to no.
It should look like this

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=no #Set according to your system (BIOS) clock.
VERBOSE=no
EDITMOTD=yes
FSCKFIX=no

These values are being used by the scripts at /etc/rcS.d/ that get invoked during boot (even in single user mode)

To be clear, this is not an Ubuntu error. It is simply the Windows that never assumes the system-clock to be in UTC.

If you wish to adjust this in the Windows installation execute regedit and navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

Change the RealTimeIsUniversal value to 1.

If you’re simply looking for a wach to change your hardwareclock on linux you can check my other article on Changing date and/or time on Linux.

How to split flash (.flv) file to upload to youtube

Say, you have a huge flv flash file you want to upload to youtube.
You’ll find yourself in trouble as there is a limit to the filesize you can upload.
Where you needed to download and install bloatware in Windows to accomplish this,
it’s super easy in Linux.

ffmpeg will do the trick.
Say you want to cut the flash movie in pieces of 10 minutes, you can do this like this:

ffmpeg -i filename.flv -ss "00:00:00" -t "00:10:00" filename_chunk.flv
ffmpeg -i filename.flv -ss "00:10:00" -t "00:20:00" filename_chunk2.flv
ffmpeg -i filename.flv -ss "00:20:00" -t "00:30:00" filename_chunk3.flv
...

Now you’re ready to upload your video’s.

Ubuntu 10.10 and ATI Radeon HD 6870

So, quite some time ago I made the mistake of buying the ATI Radeon HD 6870 without first checking if it would play nice with my Ubuntu 10.10 desktop.
Turned out it didn’t 🙁

But now, there are proprietary Linux drivers released by ATI/AMD

  1. First, you should update your system (just to be sure).

    sudo apt-get update
    sudo apt-get upgrade

  2. If you’ve been using older drivers, remove them.

    sudo apt-get remove –purge xserver-xorg-video-radeon

  3. Download the install package from the AMD suppot pages and make it executable

    chmod +x ati-driver-installer*.run

  4. Run the installer as sudo-user

    sudo ./ati-driver-installer*.run

  5. Reboot

Enjoy!

The Linux 2.6.38 kernel carries the ATI Radeon HD 6000 open source support. (just fyi!)
If you encounter problems or found this post helpful, it would be nice to leave a comment below.
This way, I can adjust it to the needs of my readers.

Nasty little OpenSSH Bug

So I’ve been using my Targa NT9231 as a home sever (Running Ubuntu 10.10 server edition) for a while now.
It’s been serving several purposes such as internal webserver, irssi, monitoring and tunneling/proxy server.

As all wise people should do, I’ve been using OpenSSH to connect to it.
Solely  connected to it from my netbook, as my desktop Ubuntu computer died after the purchase of a new ATI (curse you) Graphics card.
But now, I managed to revive my desktop (yay!) and wanted to log in on my server.
Setted up the key and wanted to transfer it to my authorized hosts file… but that gave me a bloody error:

Permission denied (publickey).

So I started to digg around and checked filepermissions, ssh_config file etc… But all seemed ok.
But then I found this little nasty openSSH Bug on launchpad.

Simply running “ssh-add” on the client fixed the problem!

Ssh-add adds identities to the authentication agent, sshagent. When run without arguments, it adds the file %HOME%/.ssh/identity. Alternative file names can be given on the command line. If any file requires a passphrase, ssh-add asks for the passphrase from the user.

I’m not sure how this could’ve helped, but hey, its a workaround that actually works 🙂

Changing date and/or time on Linux

Here’s a short and easy way to set your system and hardware clock from the command line.
Open your terminal and follow these steps.

First check the current time of your hardwareclock:

hwclock -r

Then add the right date/time to your systemclock.
In the example provided you’ll find some strange long number.
You have to read it like this (from left to right):
[01] = month (Jan) | [14] = day | [0231] = time (02:31) | [2011] = year

sudo date 011402312011

Now sync your hardware clock with the date/time you’ve just set:

sudo hwclock --systohc

Check if the hardware clock is synced right:

sudo hwclock -r

Profit!

ASP.net GridView to display DetailsView on other page

So, I’m still working on that immo website.
On some GridView.aspx page, users see a GridView  with all items in my database.
I added a select button in front of each row.
I want the to redirect the user to some other page DetailsView.aspx when he/she clicked the button.
The problem, there is no redirect option in the GUI.
Again, Microsoft… loose the markup options in the Properties window and add some more functionality.

The solution for the people out there with the same frustration:

Double click the GridView item in your GUI.
You’ll get something as:

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

End Sub

Now add the following code (note that this is in vb, so if you use C#, adjust the syntax)

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
           Response.Redirect("DetailsView.aspx?ID=" & GridView1.SelectedValue)
End Sub

You might also want to add or modify some lines in your sqlDatasource (of the destination page) to match these lines.
This way you’ll see the DetailView of the item you clicked in the GridView.

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
 SelectCommand="SELECT * FROM [Tablename]where [ID] = @ID"
<SelectParameters>
 <asp:QueryStringParameter QueryStringField="ID" name="ID" />
 </SelectParameters>
 </asp:SqlDataSource>