Ubuntu libjpeg.(a|so) not found

I recently installed Ubuntu 11.04 32 bit  on my old laptop.  I wanted to get PHP + nginx going, so I was following this page: http://bestsiteinthemultiverse.com/2011/01/installing-nginx-with-php-fpm-on-u…

After installing nginx, I tried to install PHP but ran into these errors:

configure: error: libjpeg.(a|so) not found.
configure: error: libpng.(a|so) not found.

I was able to fix the first one by installing libjpeg8-dev via

sudo apt-get install libjpeg8-dev

But I couldn’t fix the PNG issue.  After searching around the web I found this post: http://www.nigeldunn.com/2011/05/14/ubuntu-11-04-libjpeg-so-libpng-so-php-ins… which was very helpful.  Since my server is 32 bit, all I had to do was switch the path.

ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib/i386-linux-gnu/libpng.so /usr/lib/libpng.so

Voila!

Advertisements

Hamachi

Recently my friends and I bought a copy of Age of Empires III: Complete Collection for $0.10.  That’s right: 10 cents!  (Thanks SlickDeals!)

But we ran into problems trying to connect to each other.  We each could log onto the EOS network and join other people’s games.  But for some reason we could not join each other’s games (either us hosting or third party hosting).  The LAN mode did not work at all.

Hamachi to the rescue!

“LogMeIn Hamachi² is a hosted VPN service that securely connects devices and networks, extending LAN-like network connectivity to mobile users, distributed teams and business applications. You can easily create secure virtual networks on demand, across public and private networks.”

Hamachi was simple to set up.  The downloading time was actually the lengthiest part (which was not that long).  We downloaded the software.  I set up our network, and gave my friends the name and password.  And within minutes we were playing the game in LAN mode.  w00t!

How to turn off Ubuntu Server laptop screen

I set my old Dell Inspiron 8100 laptop* to run on Ubuntu Server.  Everything was running fine except one problem.  The OS would go into screen saver mode, but the screen would never turn off.  After some searching I found this [http://ubuntuforums.org/showthread.php?t=1097503] posted by 2buntu:

(run while SSH’ing into the server)
1. sudo apt-get install vbetool
2. sudo vbetool dpms off
3. sudo vbetool dpms on
4. sudo vbetool dpms off

voila! The screen is off.

SSH to VirtualBox Guest OS

My host OS is Windows 7 Home Premium.  I’m running Ubuntu Server 10.04 on VirtualBox.  This is how I set it up so I can SSH into the guest OS.

The main thing is to modify VirtualBox to forward packets from the host to the guest.  On a Windows machine, the path to VBoxManage might not be set.  If not, you can find it in your VirtualBox installation folder.  My default is: C:Program FilesOracleVirtualBox.

# add new values [1]
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort” 10022
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort” 22
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol” TCP

VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/nginx/HostPort” 10080
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/nginx/GuestPort” 80
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/nginx/Protocol” TCP

# delete by not specifying the value
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort”
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort”
VBoxManage setextradata “Ubuntu Server 64-bit” “VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol”

# see existing values
VBoxManage getextradata “Ubuntu Server 64-bit” enumerate

– “Ubuntu Server 64-bit” is your guest OS name in VirtualBox.
– “e1000” name of virtual network adapter: pcnet for PCnet-FAST III, e1000 for Intel PRO/1000 MT Desktop, and so on [2]
– “ssh” is arbitrary name you can use
– “10022” is the host OS’s port being forwarded.  Should be 1024 or higher.
– “22” is the port that the guest OS’s SSH is listening on
– “TCP” is the protocol
Once this has been added, restart the guest machine (close it and restart, not simply reboot) so it can load the new settings.  Voila!  you can now SSH into your guest OS.

sources:

2010-04-16 Setting Up a Second server

Recently we added a new server (s2) for our web app. ??So we decided to turn the old server (s1) into a dedicated database server. ??We moved the web server and everything else over to s2 then closed off s1. ??

Normally we would just put s1 into an internal network, but our data center (let’s call them DC) didn’t have that option. ??They offered similar setup using their firewall. ??I thought OK, as long as the database isn’t exposed to anybody from the “outside”, it’s good enough. ??So I asked them to set the firewall such that s1 and s2 have full access to each other, and s1 is completely closed off from everybody else (except their management for admin and backup purposes).

After a bit, they sent an email saying that it’s done. ??I thought, oh cool, that was quick and simple. ??Then I tried to remote desktop into s1 and was surprised when I got in. ??I sent an email back to DC asking if they really set it up, since I was able to access s1 from my local computer (I should only be able to access s1 via s2).

After a bit more, they sent another email saying that ti’s done. ??I tried remote desktop and was unable to get in. ??Good! ??Then I thought, since the database was the main reason we’re blocking off s1, let me try to connect to it. ??D’oh! ??I was able to access the database from my local machine. ??It turned out that DC only blocked off RDP access. ??I sent another email back telling them what happened. ??I repeated my request and wanted to make sure they understood, because I didn’t want to have to check every port to make sure that s1’s access has been blocked off.

After waiting some more (blocking off s1 wasn’t urgent), I got a third email saying that it’s done. ??So I checked RDP and the database from my local computer. ??Access denied. ??Good! ??But then??I got a phone call telling me that the web app was down and nobody could log in. I logged into S2 and try to connect S1. ??To my horror, DC had totally blocked off S1 from everybody, including s2!

My IT guy and I immediately got on the phone with DC and told them they had to grant access for s2 to s1 ASAP. ??They apologized and ??told us that our scenario was unique (wanting a server in that data center to only be accessible via another server…), and that they finally got the rules down.

Everything seems to be fine now. ??I’m still a little hesitant and going to keep an eye out for the next few days just to be sure.