Wiki - README‎ > ‎Computers‎ > ‎

Linux

Qubes OS Project [link]
"a reasonably secure operating system"

Librem 13: A laptop that respects your rights [link]

usb authentication [link]

unix tricks [link]

purge memory [link]

recover from shutdown during upgrade [link]
sudo dpkg --configure -a
sudo apt-get update
sudo dpkg --configure -a
sudo dpkg --configure -a --abort-after=99999
sudo apt-get dist-upgrade
sudo apt-get -f install
sudo apt-get dist-upgrade

ramdisk [link]
mkdir /home/ram
mkfs -q /dev/ram1 8192
mount /dev/ram1 /home/ram
chown usr.grp /home/ram

change keyboard layout [link]

get script's location, regardless from where its called!!! [link]

memusage [link]
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
set -um

# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }

# TODO support more options: peak, footprint, sampling rate, etc.

pgid=`ps -o pgid= $`
# make sure we're in a separate process group
if [ $pgid = $(ps -o pgid= $(ps -o ppid= $)) ]; then
    cmd=
    set -- "$0" "$@"
    for a; do cmd+="'${a//"'"/"'\\''"}' "; done
    exec bash -i -c "$cmd"
fi

# detect operating system and prepare measurement
case `uname` in
    Darwin|*BSD) sizes() { /bin/ps -o rss= -g $1; } ;;
    Linux) sizes() { /bin/ps -o rss= -$1; } ;;
    *) echo "`uname`: unsupported operating system" >&2; exit 2 ;;
esac

# monitor the memory usage in the background.
(
    peak=0
    while sizes=`sizes $pgid`
    do
        set -- $sizes
        sample=$((${@/#/+}))
        let peak="sample > peak ? sample : peak"
        sleep 0.1
    done
echo "memusg: peak=$peak" >&2
) &
monpid=$!

# run the given command
exec "$@"

tar gzip follow symlinks
tar czhf file.tgz file0 file1
tar xzf file.tgz

avoid duplicates in bash history [link]
# add to ~/.bashrc export HISTCONTROL=ignoredups # colon-separated list. # ignorespace: command beginning with space is not added to history # ignoredups : does not add to history if last entry is same # ignoreboth : short for ignorespace:ignoredups # erasedups : removes same entries in history before adding

execute scripts on network? [link]

restart kde [link]
kbuildsycoca4 && kquitapp plasma-desktop && kstart plasma-desktop

configured nano
$ cat /usr/local/bin/n
#!/bin/bash
nano -xzcSimT 4 $@

$ cat /usr/local/bin/np
#!/bin/bash
nano -xzEcSimT 4 $@


ubuntu-one cloud storage [link]
zend.to [link] setup ssl [link]
deja dup [link]

restricted shell [link]
# useradd -m -d /home/didi -s /usr/bin/rssh didi
# usermod -s /usr/bin/rssh old-user-name
# usermod -s /usr/bin/rssh vivek
# chsh -s /usr/bin/rssh vivek

auto-mute on startup [link]

apache [link]

ubuntu release upgrade
do-release-update -d

get public key [link]
gpg --keyserver keyserver.ubuntu.com --recv [key]
gpg --export --armor [key] | sudo apt-key add -
sudo apt-get update


Console: find how-to (link)

unofficial upgrades (link)

deb http://badgerports.org lucid main
gpg key (link)

ATI Control Center
kdesu amdcccle

Peppermint OS (link)
Portable VBox (link)
Linux Live USB (link): prefabbed linux + portable vbox

upgrade 9.10 to 10.04 Beta (link)

make gnome look like xp (link) (tar attached)

use freedos to flash bios (link)

installing nx on linux (link)
edubuntu, linux terminal and thin clients (link)

compose keyboard shortcut settings
system settings->region and layout->keyboard layout->advanced->compose key position

Mount SMB Shares (link)
$ sudo apt-get install samba smbfs
$ sudo nano /etc/fstab

# add the following line
# servername is IP (unless defined in /etc/hosts)
//servername/sharename /mountdirectory smbfs username=windowsuserename,password=windowspassword 0 0


++ backup and recovery tools
[*http://www.linuxlinks.com/article/20090105114152803/Backup.html 21 of the best free linux backup tools]
[*https://www.diino.com/c/default-en/features diino]

++ change timezone
[*http://www.wikihow.com/Change-the-Timezone-in-Linux link]


change login keyboard layout (link)
$ sudo gedit /etc/default/console-setup

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="dvorak"
XKBOPTIONS="lv3:ralt_switch"

++ add user to admin (sudo) [[code]] sudo usermod -a -G admin username [[/code]] ++ kill kdm [[code]] /etc/init.d/kdm stop [[/code]] ++ get version of (k)ubuntu [[code]] cat /etc/issue [[/code]] ++ compiling kernel stuff [[code]] sudo apt-get install build-essential sudo apt-get install linux-headers-'uname -r' [[/code]] ++ tar [*http://www.simplehelp.net/2008/12/15/how-to-create-and-extract-zip-tar-targz-and-tarbz2-files-in-linux/ from] [[code]] tar -zcvf archive_name.tar.gz directory_to_compress tar -zxvf archive_name.tar.gz tar -zxvf archive_name.tar.gz -C /tmp/extract_here/ [[/code]] ++ environment vars [*http://www.troubleshooters.com/linux/prepostpath.htm link] [[code]] PATH=$PATH:/data/myscripts [[/code]] in ~/.bash_profile (or ~/.profile, /etc/.profile), [[code]] PATH=$PATH:/data/myscripts export PATH [[/code]] ++ plasma start plasma [[code]] kstart plasma [[/code]] ++ wine [*http://www.sucka.net/2009/08/installing-adobe-cs4-in-wine/ Install Photoshop CS4] to remove the patched wine... [[code]] dpkg -r wine [[/code]] ++ look into this! *http://aldeby.org/blog/index.php/howto-ubuntu-linux-on-hp-pavilion-dv2000-dv6000-dv9000-series-laptops#suspend ++ install kde 4.3 on jaunty *http://webupd8.blogspot.com/2009/08/install-kde-43-in-ubuntu-jaunty-904.html ++ google gears [*http://alan.lamielle.net/2009/07/19/google-gears-in-firefox-3-5-in-linux-x64_64 talking about gears on 64b linux with ff 3.5] [*http://gkovacs.xvm.mit.edu/google-gears/gears-linux-x86_64-0.5.25.0.xpi gears x86-64] ++ add key for apt-get use the last 8 chars [[code]] sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 8AC93F7A [[/code]] ++ software install skype, 64b [[code]] wget -O skype-install.deb http://www.skype.com/go/getskype-linux-ubuntu-amd64; sudo dpkg -i skype-install.deb [[/code]] ++ attempts to get stuff working on dv7 +++ suspend to ram status - - - - - - - - - - - - - not working http://ubuntuforums.org/showthread.php?t=1138292&highlight=suspend+ram +++ sound status - - - - - - - - - - - - - sound: yes headphones: no mic: not tested http://ubuntuforums.org/showthread.php?t=1136670&page=3&highlight=gfxcoder RangerX_308 says that they have sound //mostly// working. > -Add the following to etc/modprob.d/alsa-base.conf > options snd-hda-intel model=hp-m4 enable=1 index=0 > options snd-hda-intel enable_msi=1 > -Upgrade ALSA to 1.0.19 per http://ubuntuforums.org/showthread.php?p=6589810 another link to check out [*http://www.ubuntugeek.com/simple-guide-to-sound-solutions-for-hardyintrepid-and-jaunty-jackalope-users.html Simple Guide to Sound Solutions for Hardy, Intrepid, Jaunty Users] [*http://forums.opensuse.org/hardware/laptop/409023-hp-pavilion-dv7-1160er-intel-hda-sound-not-work.html OpenSUSE: HP dv7 no sound] [*http://forums.opensuse.org/hardware/laptop/406225-no-sound-hp-dv7-1080ew-intel-82801i-ich9-family.html OpenSUSE: HP dv7 no sound] [*http://forums.opensuse.org/pre-release-beta/399731-beta-5-no-sound-3.html another] [*http://ubuntuforums.org/showthread.php?p=7167363#post7167363 UbuntuForums: no sound after upgrade to 9.04] this user got sound working (no headphone) [*http://wiki.debian.org/InstallingDebianOn/HP/Pavilion_dv7 link] [*http://ubuntuforums.org/showthread.php?p=5931543 UbuntuForums: How it works, SOUND] ++ rsync http://everythinglinux.org/rsync/ [[code]] rsync --progress --stats --compress -e ssh --recursive --times --perms --links ~/documents2/ /home/jonhome/documents/ [[/code]] ++ ACPI [*http://www.linux.com/articles/54610?theme=print How to suspend and hibernate a laptop under Linux] (older article) ++ Printer Sharing sudo nano /etc/cups/cupsd.conf [[code]] # # # Sample configuration file for the Common UNIX Printing System (CUPS) # scheduler. See "man cupsd.conf" for a complete description of this # file. # # Log general information in error_log - change "info" to "debug" for # troubleshooting... LogLevel warning # Administrator user group... SystemGroup lpadmin # Only listen for connections from the local machine. #Listen localhost:631 # commented by jon #Listen /var/run/cups/cups.sock # commented by jon

Listen 631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
#Browsing Off # commented by jon
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
Order allow,deny
Allow From 192.168.2.* # added by jon
</Location>

# Restrict access to the admin pages...
<Location /admin>
Encryption Required
Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an administrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-$
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>

# All administration operations require an administrator to authenticate...
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-$
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>

# All printer operations require a printer operator to authenticate...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job H$
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>

# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>

<Limit All>
Order deny,allow
</Limit>
</Policy>

#
#
[[/code]]

sudo /etc/init.d/cups restart

++ NetBeans and JavaDoc
To get Java Documentation into NetBeans, download jdk-ver-docs.zip from Sun's website. Unzip to a folder(*). In NetBeans, Tools->Java Platforms. Select the JavaDoc tab. Click Add ZIP/Folder..., browse to the folder (*) and click OK. Move the folder up in the list. Close.

++ VMWare 64b
modifier keys and extended keys (arrows, home, etc.) not working...
add to /etc/vmware/config
[[code]]
xkeymap.nokeycodeMap = true
[[/code]]

++ Server: Web + SSL + Cert, SVN
* [*http://www.xenocafe.com/tutorials/linux/centos/apache_web_server/index.php Apache Web Server Tutorial for Linux]
* [*http://www.xenocafe.com/tutorials/linux/centos/openssl/self_signed_certificates/index.php How to create self-signed SSL certs with OpenSSL]
* [*http://artis.imag.fr/~Xavier.Decoret/resources/svn/index.html SVN Tutorial for Unix]
[[code]]
svnadmin create --fs-type fsfs /var/svn/repositoryname
svn ls file:///var/svn/repositoryname
svn import /path/to/project/ file:///var/svn/repositoryname/project/trunk -m 'Initial import'
[[/code]]

++ installing nvidia driver on new install
ctrl+shift+f1
log in
sudo pkill kdm
sudo apt-get install libc6-dev
sudo apt-get install libGL.so.1?
sudo ./NVIDIA

++ fix ati screwup
Turn back to the default dirver of ati card of ubuntu 9.04 after frozed by the proprietary driver .

Form forum.ubuntu.org.cn Jun 27, 2009 5:36pm GMT
step1 Reboot;
step2 Choose "Recovery Mode" at grub menu;
step3 sudo apt-get autoremove xorg-driver-fglr, and choose "yes";
step4 Reboot again; Choose "Recovery Mode",Choose "xfix ...";
step5 After "xfix ..." Resume Normal Boot

OK

++ setting up svn
* *http://ariejan.net/2006/12/01/how-to-setup-a-ubuntu-development-server-part-1/
* *https://help.ubuntu.com/community/Subversion
* *http://www.subversionary.org/howto/setting-up-a-subversion-server-on-ubuntu-gutsy-gibbon-server
* Another, but not as good *http://www.sematopia.com/?p=66

++ Linux Quickref
*http://www.scribd.com/doc/2345013/Unix-Linux-BSD-Cheat-Sheets-II
[[collapsible show="+ show quickref" hide="- hide Linux Quickref"]]
[[iframe http://wiki.gfxcoder.us/linux/code/1 frameborder="0" scrolling="no" width="600px" height="510px"]]
[[/collapsible]]
[[collapsible show="+ details" hide="- details"]]
[*http://www.scribd.com/doc/3601/Linux-quickref link]
[[code type="html"]]
<html><head><title>Scribd: Linux Quickref</title></head><body>
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_311716596500277" name="doc_311716596500277" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle" height="500" width="100%"> <param name="movie" value="http://documents.scribd.com/ScribdViewer.swf?document_id=3601&access_key=kw3s3hyfmz5ig&page=1&version=1&viewMode="> <param name="quality" value="high"> <param name="play" value="true"> <param name="loop" value="true"> <param name="scale" value="showall"> <param name="wmode" value="opaque"> <param name="devicefont" value="false"> <param name="bgcolor" value="#ffffff"> <param name="menu" value="true"> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="salign" value=""> <embed src="http://documents.scribd.com/ScribdViewer.swf?document_id=3601&access_key=kw3s3hyfmz5ig&page=1&version=1&viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_311716596500277_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle" height="500" width="100%"></embed> </object>
</body></html>
[[/code]]
[[/collapsible]]
ċ
XpGnome.tar.gz
(2546k)
Jonathan Denning,
Apr 9, 2010, 7:34 PM
Comments