Disable natsami kernel messages

--- linux-2.6.24.3.org/drivers/net/natsemi.c	2008-02-26 01:20:20.000000000 +0100
+++ linux-2.6.24.3/drivers/net/natsemi.c	2008-03-17 12:24:50.000000000 +0100
@@ -1818,7 +1818,7 @@
 		dspcfg = readw(ioaddr+DSPCFG);
 		writew(0, ioaddr+PGSEL);
 		if (np->dspcfg_workaround && dspcfg != np->dspcfg) {
-			if (!netif_queue_stopped(dev)) {
+			if (netif_queue_stopped(dev)) {
 				spin_unlock_irq(&np->lock);
 				if (netif_msg_drv(np))
 					printk(KERN_NOTICE "%s: possible phy reset: "

installAdobeReader.sh

#!/bin/bash
 
sudo su
 
wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
apt-get update
apt-get -y --force-yes install medibuntu-keyring
apt-get update
apt-get -f --force-yes  install acroread

Reset root password on MySQL

# stop mysql
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
 
# login
mysql -u root
 
# in mysql
use mysql;
update user set password=PASSWORD("NEW_PASS") where User='root';
flush privileges;
quit
 
# start mysql
/etc/init.d/mysql start
 
# Links
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
http://www.cyberciti.biz/faq/mysql-change-root-password/

Create new MySQL DB

# BASH
echo "create database ${DB_NAME}" | mysql --user=${DB_USER} --password=${DB_PASS}
 
# SQL
mysql -u root -p 
create database db_name;
create user db_user identified by 'user_pass';
grant all on db_name.* to 'db_user'@'%';
commit;
quit;

ConvertImage with ImageMagic for Windows

@echo off
 
set imageSmall=%~dp1%~n1_klein.jpg
set imageBig=%~dp1%~n1_gross.jpg
set quality=-quality 80
 
rem small
convert.exe -resize "150x100" %quality% %1 "%imageSmall%"
 
rem big
convert.exe -resize "1000x500>" %quality% %1 "%imageBig%"

Tomcat configuration

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.tomcat.sh";
echo "wget $URL -O - | bash -";
echo "<div class=\"geshifilter\"><pre class=\"bash geshifilter-bash\">";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "</pre></div>";
?>
 
 
# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"
/usr/local/apache-tomcat-5.5.20/bin/startup.sh
 
# deploy
/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war
 
# change defau

Send mail from console

# install
sudo apt-get install -y mailx
 
# configure postfix
postconf -e 'smtp_generic_maps = hash:/etc/postfix/generic'
cat <<EOF>> /etc/postfix/generic
root@ubuntu.example.local	info@example.com
EOF
service postfix restart
postmap /etc/postfix/generic
 
# configure smtp
cat <<EOF> ~/.mailrc 
set from="YOU@YOUR_MAIL.COM"
set smtp="YOUR_SMTP_SERVER"
set smtp-auth-user="SMTP_USER"
set smtp-auth-password="SMTP_PASS"
EOF
 
# test
echo "This is a test message from ${USER}@${HOSTNAME} at $(date)" | mail -s "Test email" YOU@YOUR_MAIL.COM
 
 
# v2
sudo apt-get install nullmailer

Start app on second desktop

kstart --desktop 2 --iconify APP_NAME

Extract a RPM archive

rpm2cpio FILENAME | cpio -i --make-directories

Disable Natsemi NIC Messages

#!/bin/bash
 
# The Natsemi NIC driver for Evo T20 has a bug, it output every 5 seconds a warning messages to the console.
# You can fix that with this init script:
 
cat <<EOF> /opt/ltsp/i386/etc/init.d/disableNicMsg
#!/bin/bash
/usr/sbin/ethtool -s eth0 msglvl 0
exit 0
EOF
 
chmod 755 /opt/ltsp/i386/etc/init.d/disableNicMsg
cd /opt/ltsp/i386/etc/rcS.d/
ln -s ../init.d/disableNicMsg S20disableNicMsg
 
# update LTSP image
ltsp-update-image
Syndicate content