nano /etc/default/grub
add “reboot=bios” to the “GRUB_CMDLINE_LINUX_DEFAULT=” line
Category Archives: Reference
Ubuntu 10.04.2 Live USB
Created USB using Universal-USB-Installer-1.8.3.7.exe and ubuntu-10.04.2-desktop-i386.iso.
Edited /syslinux/text.cfg on USB as follows:
default live
label live
menu label ^Run Ubuntu from this USB
kernel /casper/vmlinuz
append noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz splash --
label live-nvidia
menu label Run Ubuntu (NVidia)
kernel /casper/vmlinuz
append noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz nomodeset --
label live-vesa
menu label Run Ubuntu (VESA)
kernel /casper/vmlinuz
append noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz xforcevesa --
label live-install
menu label ^Install Ubuntu on a Hard Disk
kernel /casper/vmlinuz
append cdrom-detect/try-usb=true file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz splash --
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80
Busybox on Rooted HTC Desire w/ Android 2.2 Froyo
Install Titanium Backup and use it to install busybox.
Boot into Recovery. If using clockworkmod, be sure to mount system and data. Using the Android SDK, from the command line, run this stuff:
adb shell cp /data/data/com.keramidas.TitaniumBackup/files/busybox /system/xbin/busybox chmod 755 /system/xbin/busybox ./busybox --install -s /system/xbin
Enable External Mail on Ubuntu
First, install the appropriate packages:
sudo apt-get install mailutils
Configure Exim for external mail:
sudo dpkg-reconfigure exim4-config
Options:
- mail sent by smarthost; no local mail
- FQDN of the system
- 127.0.0.1 (This will prevent external use of the server to send mail.)
- localhost; hostname
- FQDN of the system
- External (ISP) SMTP server
- Dial-on-Demand? No
- Split config? No
- Root/postmaster recipient: (enter the email address you wish to receive messages sent to root/postmaster on the system).
The root/postmaster recipient is stored in /etc/aliases
The Exim configuration is stored in /etc/exim4/update-exim4.conf.conf. To apply configuration manually changed in this file, run:
sudo update-exim4.conf sudo /etc/init.d/exim4 restart
Actual Exim configuration is stored in /var/lib/exim4/config.autogenerated. Don’t edit this file directly.
This was tested on Ubuntu 10.04 (Lucid)
Launch Nautilus in Ubuntu with gksu
gksu "dbus-launch nautilus --no-desktop --browser /"
Subversion Installation with Submin, WebDAV, & WebSVN
Installation of Subversion with:
- Submin for administering subversion users and repositories
- WebDAV for access to repositories
- WebSVN for browser access to repositories
Subversion Installation:
aptitude install subversion
Submin Installation:
Add the following repository to /etc/apt/sources.list:
# Submin Repository deb http://debian.supermind.nl/ current main
Install key for submin repository:
wget -q -O - http://supermind.nl/debian.key | apt-key add -
Update Package List and Install Submin:
aptitude update aptitude install submin
Create Folder Structure and Files:
mkdir /var/svn mkdir /var/svn/conf mkdir /var/svn/repos
touch /var/svn/conf/authz touch /var/svn/conf/htpasswd touch /var/svn/conf/submin.conf touch /var/svn/conf/userproperties.conf touch /var/svn/conf/apache-svn.alias
Add Submin Admin User
htpasswd -m /var/svn/conf/htpasswd administrator
Configuration File Contents:
# /var/svn/conf/authz [groups] submin-admins = administrator
#/var/svn/conf/submin.conf [svn] authz_file = /var/svn/conf/authz userprop_file = /var/svn/conf/userproperties.conf access_file = /var/svn/conf/htpasswd repositories = /var/svn/repos [www] base_url = /submin svn_base_url = /svn trac_base_url = [backend] bindir = /usr/share/submin/bin [generated] session_salt = d7xOuU8hY9cF1qB/u/
# /var/svn/conf/apache-svn.conf
# Default Apache Submin Configuration
Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
Options ExecCGI FollowSymLinks
AddHandler cgi-script py cgi pl
SetEnv SUBMIN_CONF /var/svn/conf/submin.conf
RewriteEngine on
RewriteBase /submin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ submin.cgi/$1
RewriteRule ^/?$ submin.cgi/
Order Allow,Deny
Allow from all
</Directory>
# WebDAV Configuration
<Location /svn>
DAV svn
SVNParentPath /var/svn/repos
AuthzSVNAccessFile /var/svn/conf/authz
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/svn/conf/htpasswd
Require valid-user
Order Allow,Deny
Allow from all
Satisfy Any
</Location>
# WebSVN Configuration
Alias /websvn "/var/svn/websvn/"
<Directory "/var/svn/websvn/">
Options -Indexes -FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/svn/conf/htpasswd
Require valid-user
Order Allow,Deny
Allow from all
Satisfy All
</Directory>
# Disallow web access to directories that don't need it
<Directory "/var/svn/websvn/include">
Order Deny,Allow
Deny from All
</Directory>
WebSVN Installation
- Download WebSVN from http://www.websvn.info/download/.
- Extract the contents of the archive to
/var/svn/ and rename the folder from 'websvn-?.?.?' to just 'websvn‘.
cd /var/svn wget http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz tar -xvzf websvn-2.3.1.tar.gz mv websvn-2.3.1 websvn
- Configure WebSVN with the following file:
<?php
// # /var/svn/websvn/include/config.php
$config->setSvnConfigDir('/etc/subversion');
$config->parentPath('/var/svn/repos');
$config->addTemplatePath($locwebsvnreal.'/templates/calm/');
$config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/');
$config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');
$config->useAuthenticationFile('/var/svn/conf/authz'); // Global access file
$config->addInlineMimeType('text/plain');
$config->setMinDownloadLevel(2);
$config->useGeshi();
set_time_limit(0);
$config->expandTabsBy(8);
Configure Permissions:
chown -R root:www-data /var/svn chmod -R ug=rwX,o= /var/svn/conf chmod g-w /var/svn/conf/apache-svn.conf chmod -R ug=rwX,o= /var/svn/repos chmod -R 750 /var/svn/websvn
Configure Apache:
- Enable Apache Mod Rewrite
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
- Include the required apache configuration by adding a symlink to the apache conf.d directory
ln -s /var/svn/conf/apache-svn.conf /etc/apache2/conf.d/apache-svn.conf
- Restart Apache Server
/etc/init.d/apache2 restart
SVN on Ubuntu
Repository Location: /var/lib/submin/svn
/etc/apache2/sites-available/fender-svn.alias
# /submin and /svn from /etc/submin/default-apache-cgi.conf
Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
Options ExecCGI FollowSymLinks
AddHandler cgi-script py cgi pl
SetEnv SUBMIN_CONF /etc/submin/default.conf
RewriteEngine on
RewriteBase /submin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ submin.cgi/$1
RewriteRule ^/?$ submin.cgi/
Order Allow,Deny
Allow from all
</Directory>
<Location /svn>
DAV svn
SVNParentPath /var/lib/submin/svn
AuthzSVNAccessFile /var/lib/submin/authz
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/lib/submin/htpasswd
Require valid-user
Order Allow,Deny
Allow from all
Satisfy Any
</Location>
Alias /websvn "/var/www/websvn/"
<Directory "/var/www/websvn/">
Options -Indexes -FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/lib/submin/htpasswd
Require valid-user
Order Allow,Deny
Allow from all
Satisfy All
</Directory>
Netbeans Installation and Import from Subversion Repository
Package Installation:
- Install the Java Development Kit from here.
- Install the Netbeans PHP Bundle from here.
- Install the CollabNet Subversion Client for Netbeans from here.
Configuration:
- Start the NetBeans IDE
- Tools menu > Plugins … Install the “Bundled Subversion Client for Windows” plugin.
- Tools menu > Options >> Misc page > Versioning tab > Subversion …
Path to the SVN executable: CollabNet SVN Client installation folder
Import Project from Subversion Repository:
- Team Menu > Subversion >Checkout…
- Note that NetBeans project Run properties will need to be manually configured.
Simple PHP script to Tar a folder
Here it is…
<?php
$path = explode("/",realpath('./'));
$filename = date("Y-m-d_His") . "_" . array_pop($path);
echo "<pre>Compressing ./* to ../${filename}.tgz</pre>";
$output = shell_exec('tar -cvz --exclude "./dotar.php" -f ../' . $filename . '.tgz ./*');
echo "<pre>$output</pre>";
echo "<pre>Done.</pre>";
?>
Delay between username and password on SSH login
The delay is likely caused by the server being unable to do a reverse dns lookup for the client machine. There are a couple of solutions:
- Add the client’s hostname and IP address to the server’s /etc/hosts file
- Add the PTR record for the client machine to the DNS server.
- Add the following line to the server’s /etc/ssh/sshd_config file:
UseDNS no