rpm -qa –qf ‘%10{SIZE}\t%{NAME}\n’ | sort -k1,1n
Month: November 2012
Clearing up a root partition and removing pointless packages and dependencies
disk space, linuxOur default template for the root partition has only 4GB assigned. I wanted to remove some pointless packages and these two commands below cleared up around 1GB on the disk.
rpm -e java-1.4.2-gcj-compat-javadoc
yum remove emacs-common mesa-libGL xulrunner-devel
yum remove alsa-lib-devel redhat-logos
Downloading the JDK from Oracle’s page from the command line
java, jdk, oracleSince earlier in 2012, Oracle included a non-optional requirement that you need to Accept the T&C’s when downloading the JDK from their site. As you already agree the terms and conditions once you actually install or run the bin file, it isn’t absolutely necessary.
There’s a way around it using cookies, and I was able to download the file I needed when including the following cookie:
wget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F”http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-i586.bin
In PHP, converting Shift-JIS into UTF-8
phpStill some websites use Shift-JIS character sets instead of UTF-8. To convert Shift-JIS Japanese text into a more friendly UTF-8 format, I needed to include the following in my PHP code:
$converted_string = iconv(‘shift-jis‘,’utf-8‘.’//TRANSLIT’,$string_to_convert);
Of course it’s also possible to store the data in MySQL using a BLOB data type, but I wanted to use standard text/varchar, and make it searchable. This worked well.
The same can also be applied for converting the other way, when needing to convert UTF-8 to Shift_JIS.
$converted_string = iconv(‘utf–8‘,’shift-jis‘.’//TRANSLIT’,$string_to_convert);
Installing jdk6+ and setting update-alternatives for java
javawget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F” http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-i586.bin
chmod a+x jdk-6u37-linux-i586.bin
./jdk-6u37-linux-i586.bin
mv jdk1.6.0_37/ java-6-oracle
mv java-6-oracle/ /usr/lib
sudo mkdir /usr/lib/jvm
cd /usr/lib
mv java-6-oracle/ jvm
sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/java-6-oracle/bin/java” 1
sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/java-6-oracle/bin/javac” 1
sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/lib/jvm/java-6-oracle/bin/javaws” 1
Installing an old version of java on CentOS / x64
javaVery quick and easy:
wget http://uni-smr.ac.ru/archive/dev/java/JRE/Last-yet-Sun/jre-6u20-linux-x64.bin
./ jre-6u20-linux-x64.bin
mv /file/somewhere /else
installing NTP
ntpinstalling java and maven on CentOS
java, maveninstalled java:
export PATH=${M2_HOME}/bin:${PATH}
installing git on CentOS
gitto install git on CentOS, simply follow these instructions:
Open MySQL for all IP addresses
mysqlGRANT ALL ON *.* TO root@’%’ IDENTIFIED BY ‘yourpassword’;