August 17, 2011
Advance Configuration and Power Interface (ACPI) or APM ( Advance Power Management ) support for Ubuntu 10.04 was not installed by default after server installation. I needed this so that during power outage I can just press the power button to automatically shutdown the PC.
sudo aptitude install acpi acpi-support apm
This will install the power-button-power-off feature in you server.
Posted in Linux, Mods, Tips & Tricks
No Comments »
August 7, 2011
82579 based Ethernet network cards are only supported in Kernel 2.6.36 and up, thus Ubuntu 10.04 LTS will not have out-of-the-box support for the network card. I needed this to work since I’ll be using this as my server and 11.04 is not LTS, I have no choice. To fix this with the motherboard I have from Intel, here are the steps that I did…
- Download the driver source from Intel driver webpage here, or the latest one they have. Double check if the driver supports the version of the network card, the one I have is 82579.
- Ready the Ubuntu server, install make gcc g++ and linux headers
aptitude install make gcc g++ linux-headers-`uname -r`
- Un-pack the src driver that you just downloaded, compile and install.
gunzip [filename].tar.gz
tar -xvf [filename].tar
cd [folder_name]/src
make install
- If everything goes well, no error should come out, then enable your new ethernet card.
- You can check your new network card via ifconfig
Enjoy!
Note: If you update your kernel or linux image via aptitude safe-upgrade or dist-upgrade, you need to remove the e1000e module, re-compile the driver and install the newly compiled driver again.
Posted in Linux, Mods, Tips & Tricks
4 Comments »
June 28, 2011
Here’s a way to block users from using a different DNS address other than your own local DNS server to bypass OpenDNS filtering. I’m currently using Shorewall in an Ubuntu 8.04 LTS server setup as my Firewall, Gateway and DNS, and works nicely. This should also work in 10.04 or other Ubuntu install that has Shorewall firewall. Side effect for the user will be that they wont be able to surf the net until they revert back to the assigned DNS to use.
In your Shorewall Rules file, add this above the other rules.
DNS/ACCEPT $FW net
DNS/ACCEPT net $FW
DNS/DROP loc net
DNS/DROP net loc
$FW is your firewall/gateway and in my setup my DNS. You can change $FW to loc:<dns_ip_address> if your DNS is located in another machine other than your gateway.
Have fun raining in on their parade
P.S. You can add filters to allow certain IP or MAC addresses to use DNS outside (i.e. Google DNS ).
Posted in Linux, Tips & Tricks
No Comments »
November 5, 2010
I have a linux Ubuntu server and a dynamic IP for the DSL connection. The office needs web filtering and getting a static IP will just add cost to the now tight budget. Looking around there is actually a way to update OpenDNS IP address under linux. Below are what is needed to be installed and configured.
- Any latest Ubuntu server ( I’m using Ubuntu 10.10 Server )
- ddclient installed (use “aptitude install ddclient”)
- net connection, I have set up my linux server as a firewall/gateway
After installing ddclient, go to /etc and edit ddclient.conf, below is the format that I used, modify it to suite your configuration.
ssl=yes
use=web, web=whatismyip.org
server=updates.opendns.com
protocol=dyndns2
login=<openDNS_username_here>
password='<openDNS_password_here>'
<openDNS_network_label_here> #this can be found under settings, just the label, nothing else should be added here
Save the new configuration file and restart the client /etc/init.d/ddclient restart
Also make sure that the network that your going to update the IP address has set its Dynamic IP Update option enabled. This can be found under the advance setting of the network.
Posted in Code Library, Tips & Tricks
No Comments »
February 13, 2010
Ran into a problem returning an XML data with special characters encoded into it through an AJAX call. The problem was that special characters (i.e. ñ -> ñ) throws an error when being returned through XML and is in the process of being parsed by the browser.
The catch?
XML does not support named entities by default, you have to declare it before hand. Only < > & " and ' are predefined.
Something like:
1
2
3
| <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
Got this from here…
The fix…
Instead of using named entities in the XML (I think this also affects JSON, I could be wrong since I didn’t test this is JSON) like ñ, use character references to support special character encoding.
Example:
white space = =  
ñ = ñ = ñ
they are all the same… #160 is referenced/mapped to ” ” and #241 is referenced/mapped to ñ
So when forming your XML before returning it through an AJAX call, form the special characters via character reference.
Hope this helps you out there having this problem.
Posted in Tips & Tricks
No Comments »
February 13, 2010
Encountered this problem today while testing an image upload AJAX script in tomcat. Later on I found out that the folder is actually protected Win7 and tomcat couldn’t write the cache or temporary file into the folder.
So anyone having this problem, check the following…
- What OS are you running? Vista/Win7?
- What IDE are you using?
- Was your IDE elevated to admin status?
So, check your OS, I’m using Win7. I was developing this under WinXP a few months back, and now under Win7, the folder is protected since it was under the “Program Files (x86)” folder group. (Argh!)
I closed my IDE, using IDEA IntelliJ 9.0, ran the IDE under “Administrator Level” and the problem disappeared!
So check those out first.
Posted in General, Tips & Tricks
No Comments »
November 17, 2009
I’m now developing in flash actionscript 2…. ok from one language to the other….
Posted in General
No Comments »
May 5, 2009
I’m currently playing around with Java Native Interfaces(JNI) and I must say its been too long since I programmed in Java. Its good to be back! Anyway, lets hop to the main topic…
I was following the tutorial from Sun in creating my first JNI and calling my compiled C++ library, I was stuck in the last part where this error popped out whenever I tried to invoke
the error was…
java.lang.UnsatisfiedLinkError: no HelloWorld in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at HelloWorld.<clinit>(HelloWorld.java:<line number>)
Could not find the main class: HelloWorld. Program will exit.
</line></clinit>
one way of fixing this is to include the current location of your newly compiled shared library (ex. HelloWorld.so). I’m using Ubuntu linux,so to include the current folder where your “.so” file is located, invoke…
LD_LIBRARY_PATH=`pwd`
export LD_LIBRARY_PATH
or you can also do …
Read the rest of this entry »
Posted in Code Library, Tips & Tricks
8 Comments »
February 27, 2009
Seems like I got caught up with my work again, ah well que sera sera… I’ll be posting some new stuffs later on, one will be mysql replication through SSH tunneling and the other are tips on extjs javascript framework I have been using for over 2 years now. Should have done this a looooong time ago.
Stay tune
Posted in General
No Comments »
Recent Comments