Linux Tips

ElijahLofgren

I follow Jesus Christ, enjoy helping people, and like making websites. Who is Jesus?

Jesus gives me overflowing hope, peace, and joy in this short life of mine. You can have it too! :)

My life mission: "Whatever you do, do it all for the glory of God." - 1 Corinthians 10:31

You are here: Home » Linux Tips

Linux Tips

Contents

Find Linux Programs

Visit the Linux App Finder.

Linux App Finder

Get a list of all running programs with their RAM and CPU usage

Run this command:
ps aux

Mount smbfs Shares Permanently

See the: Mounting smbfs Shares Permanently Help File.

Qucs: Quite Universal Circuit Simulator Tips

To fix: error like: "WARNING: TR1: inserted virtual resistance at node `_net0' connected to [L1,D1,T2]" you need to insert a ground or two in your circuit.

Learn more about Linux

How to untar a tar.gz file using the command line

Modified: 2008-05-15 21:52:21

From Linux.com :: File compression tools for Linux:

Use
tar zxvf archived.tar.gz
to extract all the files from a gzip-compressed tarbal

Better: make "untar" alias"

Logout/login after making change

diff --git a/.bashrc b/.bashrc
index 6e6d1e1..2464e23 100644
--- a/.bashrc
+++ b/.bashrc
@@ -5,7 +5,7 @@
 alias rm='rm -i'
 alias cp='cp -i'
 alias mv='mv -i'
-
+alias untar='tar zxvf'
 # Source global definitions
 if [ -f /etc/bashrc ]; then
        . /etc/bashrc

Read TUX Magazine

Modified: 2007-03-13 12:14:06

Read TUX Magazine which is the first and only magazine for the new Linux user (no longer free).

TUX Magazine

Fix Printer Margins

Modified: 2007-03-13 12:06:43

From http://www.nerdylorrin.net/wiki/Wiki.jsp?page=CUPS

Configuring the Margins

Run the following commands:

cd /tmp
wget http://www.linuxprinting.org/download/printing/alignmargins
wget http://www.linuxprinting.org/download/printing/align.ps
chmod 755 alignmargins
su
./alignmargins

This will print an alignment page. Text at the top of the page should indicate the currently set Margins and HWMargins. If these aren't all set to 0, enter 0 at every prompt and start over.

The first task is to align the output within the physical page. Measure H and V (in inches) from the edge of the page and calculate x and y as explained on the print out. Enter 0 for all the m* values and the calculated x and y values. 

Actually just experiment with changing the x and y values. I had to do 0 for x and -45 for y. Keep setting the m values to 0. I don't know what they are for.

Listen to the Linux Reality Podcast

Modified: 2007-03-13 12:48:42

Listen to the Linux Reality Podcast which is a podcast for the new Linux user.

Use the Super Grub Disk to restore Grub after installing Windows

Modified: 2007-05-21 10:55:45

I used Super Grub Disk along with EasyBCD to make it so that I could boot back into Kubuntu after installing Windows Vista by following the Adding Linux to the Vista Bootloader instructions.

Access Windows Shares reliably using Samba

Modified: 2007-06-04 15:58:37

Make sure to add an entry for the Windows machine in your /etc/hosts file.

Irssi: how to keep Private messages from disappearing in other windows

Modified: 2007-08-10 10:30:22

I think the important ones are:

  • use_status_window = "no";
  • use_msgs_window = "no";

Have something like this in ~/.irssi/config

settings = {
 core = {
   real_name = "Elijah Lofgren";
   user_name = "elijahlofgren";
   nick = "elijahlofgren";
 };
 "fe-common/core" = {
   autocreate_own_query = "no";
   autocreate_query_level = "NONE";
   use_status_window = "no";
   use_msgs_window = "no";
   autoclose_windows = "no";
   reuse_unused_windows = "yes";
   windows_auto_renumber = "no";
   print_active_channel = "yes";
   theme = "elho";
   beep_msg_level = "msgs";
   window_auto_change = "yes";
   autocreate_split_windows = "yes";
 };
};

Easy way to count occurances of a string

Modified: 2007-08-24 22:14:57

grep -r "php" * | wc -l

KDE Tips

Get Kopete working with Google Talk

Follow the instructions on the Google Talk support page in the KDE Wiki.

Use Qwenview to scroll through pictures

I've found that Qwenview is better and more configurable than Kuickshow for scroll through pictures.

Enable XDMCP in KDM

XDMCP needs to be enabled in order for KDM to accept incoming remote X sessions.

Open /etc/kde3/kdm/kdmrc and find:

[Xdmcp]
# Whether KDM should listen to incoming XDMCP requests.
# Default is true
Enable=false

change it to:

[Xdmcp]
# Whether KDM should listen to incoming XDMCP requests.
# Default is true
Enable=true

Open /etc/kde3/kdm/Xaccess and change:

#*           #any host can get a login window

to:

*           #any host can get a login window

Shortcuts

Make KDE (and KMail) use Mozilla Firefox for http and https URLs

  1. Open up the KDE "Control Center" (kcontrol).
  2. Click on "KDE Components"
  3. Click on "Component Chooser"
  4. Under "Component Chooser" on the right click "Web Browser"
  5. Under "Default Component" click "Open http and https URLs in the following broswer".
  6. In the blank type "firefox"
  7. Click the "Apply" button

Control Window Maximization

If you want to only maximize the current window horizontally, click the Maximize button with the right mouse button. If you want to maximize the window vertically click the Maximize button with the middle mouse button.

Easily take a screenshot by pressing the Print Screen key

Would you like to be able to easily take a screenshot just by pressing the "Print Screen" key? It's not just possible, it's very easy!

Here's how:

  1. Open up the KDE "Control Center" (kcontrol).
  2. Under "Regional & Accessibility" go to "Keyboard Shortcuts".
  3. Go to the "Command Shortcuts" tab.
  4. Select "Graphics->More Applications->KSnapshot".
  5. Under "Shortcut for Selected Command" select "Custom".
  6. Press your "Print Screen" key.
  7. Click the "Apply" button.

Fix yuvscaler error in digikam

Follow the instructions in Comment #3 of Bug 109739: yuvscaler error in digikam.


Arch Linux Tips

  • How to upgrade Arch Linux

    Fetch list of updates updates and Upgrade all packages:

    # pacman --sync --refresh --sysupgrade

    Just Upgrade:

    # pacman -Su
  • Install Packages from UNSUPPORTED

    In the ArchLinux User-community Repository there are packages for Arch Linux that are not available elsewhere. For instructions on how to install a package from UNSUPPORTED see How to use the AUR in the ArchWiki.

  • Get auto-starting of KDE screensavers working

    See my KDE Tips page.

  • Set up Apache, PHP, and MySQL

    See the LAMP (Linux Apache MySql PHP) ArchWiki page.

  • Easily disable a kernel module from being automatically loaded

    You can easily disable a kernel module by adding a line to /etc/modprobe.conf. I disabled one of my sound cards by adding the following line to the bottom of /etc/modprobe.conf:

    blacklist snd_ens1371
  • Enable any user to write to a FAT32 partition

    See the Writing on a FAT32 partition as a normal user ArchWiki page.

  • Get display of embeded PDFs in Mozilla Firefox working

    Install mozplugger and kpdf.

  • Get playback of MIDI files in background of web pages working

    1. Install timidity++
    2. Install mozplugger
    3. Get a soundfont:
      wget ftp://ftp.personalcopy.net/pub/Unison.sf2.gz
    4. Extract soundfont:
      gunzip Unison.sf2.gz
    5. Make directory for soundfont:
      mkdir /usr/share/soundfonts
    6. Move soundfont to soundfont directory:
      mv Unison.sf2 /usr/share/soundfonts
    7. Add the following line to the bottom of /etc/timidity++/timidity.cfg
      soundfont /usr/share/soundfonts/Unison.sf2
    8. Open /etc/mozpluggerrc and change:

      audio/x-midi:midi,mid:MIDI audio file
      controls noisy stream: timidity -Od "$file"
      controls: playmidi "$file"

      to:

      audio/x-midi:midi,mid:MIDI audio file
      controls noisy stream: wget "$file" -O midifile.mid && timidity midifile.mid
      controls: wget "$file" -O midifile.mid && timidity midifile.midi

Cool Linux Games

X-Moto

In X-Moto you are driving a motorcycle. It's not 3D, but it's challenging and quite fun to play.

Koules

Koules is a fun multiplayer game in which the goal is to bounce all the koules fighters out of your sector

Frozen Bubble

Frozen Bubble is sort of like a reverse tetris. You are shooting frozen bubbles and once you get three of a kind next to eachother they disappear. The goal of each level is to get rid of all the frozen bubbles.

LinCity-NG

LinCity-NG is a game similar to Sim City.

Note: For a list of much more cool linux games, please see: Ubuntu Linux Games Page


Debian Linux Tips

I ran Debian Etch (Testing) about the time I wrote most of this page.

Hardware

  • Disable second sound card so that flash will work

    1. Add a line like the following to /etc/modprobe.d/blacklist

      blacklist snd_ens1371
    2. Reboot.
  • Get KDE Media Daemon to pop up when inserting CD or removable device

    Install "hal".

  • Enable mounted CDs to be ejected when eject button is pushed

    1. Open /etc/sysctl.conf and add the following line:

      dev.cdrom.lock=0
    2. Reboot your computer.
  • Enable USB devices to be mounted by users without adding entry in /etc/fstab

    Install pmount.

  • Install Nvidia Graphics Driver

    Follow the NvidiaGraphicsDrivers guide in the Debian wiki and then install and run nvidia-xconfig to enable the Nvidia Driver.

Microsoft

  • Allow all users to write to Windows 98 partition

    Add a line like this to /etc/fstab:

    /dev/hdb1       /windows    vfat    users,rw,umask=000   0  0
  • Run old DOS games

    Install and use dosbox:

    apt-get install dosbox

Multimedia and Plugins

  • Enable install of multimedia codecs

    Follow the instructions at the bottom of the Unofficial Debian Packages page.

  • Make Fullscreen in MPlayer work

    Open /etc/mplayer/mplayer.conf and find:

    zoom=no                 # Enable software scaling (powerful CPU needed)

    change it to:

    zoom=yes                # Enable software scaling (powerful CPU needed)
  • Get playback of embedded MIDI files working in Firefox

    Install timidity and newest mozplugger from http://mozplugger.mozdev.org/. Find the newest Debian (.deb) package from http://dagobah.ucc.asn.au/mozplugger/ and use that.

  • Get embedded PDFs in Firefox with Acrobat Reader working

    1. Install newest mozplugger from http://mozplugger.mozdev.org/. Find the newest Debian (.deb) package from http://dagobah.ucc.asn.au/mozplugger/ and use that.

    2. Open /etc/mozpluggerrc and replace:

       ifelse(esyscmd([acroread -helpall | grep openInNewWindow]),[],[
        define(ACROREAD,[ACROREAD_FLAGS(): acroread ACROREAD_OPTS() +useFrontEndProgram "$file"])
       ],[
        define(ACROREAD,[ACROREAD_FLAGS(): acroread ACROREAD_OPTS() -openInNewWindow "$file"])
       ])
      

      with:

      # ifelse(esyscmd([acroread -helpall | grep openInNewWindow]),[],[
      #  define(ACROREAD,[ACROREAD_FLAGS(): acroread ACROREAD_OPTS() +useFrontEndProgram "$file"])
      # ],[
        define(ACROREAD,[ACROREAD_FLAGS(): acroread ACROREAD_OPTS() -openInNewWindow "$file"])
      # ])
      
  • Get embedded WAV files working in Firefox

    Install mozilla-mplayer:

    apt-get install mozilla-mplayer
  • Install Sun Java Plugin for Firefox

    Enable the Debian Unofficial repository and install the "mozilla-sun-j2se5.0-binary" package.

  • Easily create flash video tutorials

    Enable the Debian Unofficial repository and install the "wink-binary" package.

    You can find out more about Wink by visiting the Wink Homepage.

Packages

  • Find which files come in which packages

    I needed to find out the packages that provided "sane-config". I found out that using "apt-file" allows you to search and find in which package a file is included.

    To search packages file contents with apt-file:

    1. Install apt-file:

      apt-get install apt-file
    2. Resynchronize the lists of the contents of packages from their sources:

      apt-file update
    3. Find which packages contains a certain file. (Example: "sane-config"):

      apt-file search sane-config
  • Install a few packages from unstable and keep everything else on testing

    1. Open /etc/apt/apt.conf and add this line:

      Apt::Default-Release "testing";
    2. Open /etc/apt/sources.list and add the following 2 lines:

      #### unstable #########
      deb http://ftp.us.debian.org/debian unstable main non-free contrib
    3. Run:

      apt-get update

    Now you can choose to install packages from unstable but your packages from testing will not be upgraded to be unstable versions.

Improving Looks

  • Make GTK apps look better

    1. Run:

      apt-get install gtk2-engines-clearlooks gtk-theme-switch
    2. Run:

      gtk-theme-switch2
    3. Choose "Clearlooks" and click Apply.

  • Remove KDE Dragon from Logout menu

    Run this command:

    rm /usr/share/apps/ksmserver/pics/shutdownkonq.png

Old stuff

I run Debian Sarge (Stable). On this page is fixes for problems I have run into and some tips for setting stuff up.

  • Work around inconsistent naming of network interfaces by the kernel

    I had trouble with the names of eth0 and eth1 being switched randomly each time I booted up. This made network configuration very troublesome. Read below for the solution that I found.

    From Dealing with inconsistent naming of interfaces by the kernel and Laptop Ethernet Configuration

    1. Install the get-mac-address.sh script:

      # install -m770 /usr/share/doc/ifupdown/examples/get-mac-address.sh \
      /usr/local/sbin/
    2. Open "/etc/networking/interfaces" and make it have a section like this in it (change the MAC addresses to those of your network cards):

      mapping eth0
      script /usr/local/sbin/get-mac-address.sh
      map 00:0C:6E:B3:A0:C0 net1
      map 00:05:5D:4B:96:7F lan1

      mapping eth1
      script /usr/local/sbin/get-mac-address.sh
      map 00:0C:6E:B3:A0:C0 net1
      map 00:05:5D:4B:96:7F lan1

      auto eth0
      auto eth1

      # Internet
      iface net1 inet dhcp

      # Lan
      # iface eth0 inet dhcp
      iface lan1 inet static
      address 192.168.1.7
      netmask 255.255.255.0
      # gateway 192.168.1.1
  • Fix "Superblox last write time is in the future" error"

    Open "/etc/default/rcS" and make sure the following options are set:

    # Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
    UTC=yes
    # Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
    FSCKFIX=yes
  • Enable install of msttcorefonts

    Open "/etc/apt/sources.list" and change the following line from:

    deb http://mirrors.kernel.org/debian/ unstable main

    to:

    deb http://mirrors.kernel.org/debian/ unstable main contrib
  • Easily install Java plugin for Firefox

    Follow the instructions about the Java packages for Debian.

  • Get Minolta-QMS Magicolor 2300 DL Printer working

    Follow the instructions on this page: Linux Hardware Info Minolta Magicolor 2300DL < Main < TWiki:.


Linux Video Editing Tips

Edit DVDs with Avidemux

Using Avidemux you can edit the vob files off a DVD (vob files are just mpegs I think).

Burn Video DVDs with K3b

Say you have your "AUDIO_TS" and "VIDEO_TS" folders ready and you want to use them to burn a DVD video, here's how to do that:

  1. Run this command replacing "mydvd" with the name of the folder containing the "AUDIO_TS" and "VIDEO_TS" folders:

    mkisofs -dvd-video -o mydvd.iso mydvd/
  2. Open K3b and go to "Settings -> Configure K3b"
  3. Click on "Programs"
  4. Click on the "User Parameters" tab.
  5. Double-click under "Parameters" next to "growisofs"
  6. Paste: "-dvd-compat" in the blank. (The "-dvd-compat" option enables maximum media compatibility with DVD-ROM/-Video.)
  7. Click on the "Programs" tab.
  8. Click the "OK" button.
  9. Click the "Burn DVD ISO Image..." button.
  10. Click on the blue "folder" icon.
  11. Find and select "mydvd.iso" and click the "OK" button.
  12. Click the "Start" button.

Easily Create DVDs with Menus

Use KMediafactory which uses templates to allow you to quickly and easily create DVDs with great-looking menus.

Make Cinelerra look much nicer!

I just saw this screenshot of Cinelerra using the Blue Dot theme and I was like "WOW! It looks like a KDE app!".

Here's how to switch to using the Bluedot theme in Cinelerra:

  1. Go to Settings -> Preferences...
  2. From the drop-down list choose "Interface".
  3. Under the "Editing" next to "Theme:" select "Blue Dot" instead of "Blond" from the drop-down list..
  4. Click "OK".
  5. Close and reopen Cinelerra.

Now Cinelerra should look much nicer.

Get DVDShrink working under Wine

See the following pages:

  1. HOWTO: dvdshrink in wine
  2. Wine DVD-Shrink: CD-Rom Fix

Familiar Linux Tips

Tips on this page are for Familiar Linux which runs on iPAQ Pocket PCs. I use the Open Palmtop Integrated Environment (Opie). I have a H3850 iPAQ Pocket PC.

This page is a work in progress. ;)

Networking

Connect to the Internet through the USB connection of your cradle.

Adapted from: Connecting Your Linux Handheld to a Linux Desktop via USB

Note: These command need to executed on the host PC that your are connecting your Pocket PC to, unless specified otherwise.

Note Also: These instructions are what worked for me with Kubuntu 6.06 and Familiar 0.8.3

  1. Add usbnet to be autoloaded on startup by running the following 2 commands as root (sudo -i):

    echo "usbnet" > /etc/modutils/usbnet
    update-modules
  2. Add the following to /etc/network/interfaces

     mapping hotplug       
    script grep
    map usb0

    iface usb0 inet static
    address 192.168.2.200
    netmask 255.255.255.0
    broadcast 192.168.2.255
    pre-up /etc/network/ipaq

    Note: I had to use 192.168.2.200 (notice using 192.168.2 instead of 192.168.0 or 192.168.1) because 192.168.1 and 192.168.0 were already being used for eth0 and eth1.

  3. Add script /etc/network/ipaq

     #!/bin/sh
    sleep 5
    exit 0
  4. Ensure that /etc/network/ipaq is executable

    sudo chmod a+x /etc/network/ipaq
  5. Now on the Pocket PC add this in /etc/network/interfaces

    iface usbf inet static
    address 192.168.2.202
    netmask 255.255.255.0
    network 192.168.2.0
    gateway 192.168.2.200
  6. Put PocketPC in cradle
  7. Run the following on host (This fixes freeze on PocketPC):

    sudo ifup usb0
  8. Add the following line to /etc/hosts:

    192.168.2.202 ipaq
  9. Try pinging your iPAQ:

    ping ipaq
  10. If that does not work, maybe run modprobe usb-eth on Pocket PC or maybe run ifup usbf on Pocket PC.
  11. Use firestarter to enable NAT (Internet Connection Sharing) for Local network connected device "usb0":

    1. Open firestarter.
    2. Click on "Edit -> Preferences"
    3. Click on "Network Settings"
    4. Under "Local network connected device":

      1. Next to "Detected device(s):" select "Unknown device (usb0)"
      2. Check the "Enable Internet connection sharing" box.
    5. Click the "Accept" button.
  12. Copy /etc/resolv.conf into your ipaq:

    sudo scp /etc/resolv.conf  ipaq:/etc
  13. Try pinging google.com on your iPAQ:

    ping google.com

How to copy files to and from your Pocket PC

To Backup PocketPC:

mkdir ~/pocketpc/
sudo scp -rv ipaq:/home/root/ ~/pocketpc/

Use scp to copy files to your pocket PC. For example:

sudo scp ~/LQ-Podcast-033006.mp3  ipaq:/home/root

How to ssh into your Pocket PC

Run something like this:

ssh ipaq -l root

Installing

Settings I used when installing Familiar with minicom

Adapted from Modify your h2200 cradle to provide a serial port

  1. Using minicom on the host, start with:

    minicom -s

    (you don't need to be root, but you do need privilleges for the port)

  2. Set the port parameters:

       A   Serial Device    /dev/ttyS0 
    B Lockfile Location /var/lock
    C Callin Program
    D Callout Program
    E Bps/Par/Bits 115200 8N1
    F Hardware Flow Control Yes*
    G Software Flow Control No
  3. Save settings as default, insert your iPaq in it's cradle and restart minicom with:

    minicom -o

Samba Tips

  • Share Windows files with VMware

    Here's what I have set in /etc/samba/smb.conf to share my Windows files with VMware:

    # Security mode. Defines in which mode Samba will operate. Possible
    # values are share, user, server, domain and ads. Most people will want
    # user level security. See the Samba-HOWTO-Collection for details.
       security = share
    
    [Windows]
    path = /mnt/windows
    comment = Windows Files
    available = yes
    browseable = yes
    public = yes
    writable = yes
    

Linux Programs I Use

Web Browsing & Email

File Management

  • Konqueror

    Konqueror - Konqueror is the file manager that is included with KDE. It is both intuitive and powerful. It also doubles as a Web Browser and FTP file transer client.

Word Processing

  • OpenOffice.org

    OpenOffice.org - A complete office suite to rival MS Word.
  • K Desktop Environment

    KDE - KDE is a powerful fast Desktop Enviroment. It rocks!

General Linux Tips

  • Easily copy files between computers using scp

    The scp command allows you to easily copy files between computers using ssh. See the Secure Copy page in the Wikipedia.

  • Easily Run X Sessions over network without need for VNC!

    Today, I worked for hours and hours trying unsuccessfully to get TightVNC or RealVNC working correctly. I finally came across a post on the Gentoo Forums that suggested running:
    X -query $HOSTNAMEOFCOMPUTER
    Sure enough, IT WORKED!. I found out more info about it by running X --help:
    -query host-name contact named host for XDMCP
    So now I've put X -query tux in the .bash_profile of the users on two of my low powered boxes. I then just login through the text console and the KDM login screen from my high powered box shows up. Also, the performance seems MUCH better than VNC ever was!

  • Use Special Keys on Keyboard

    I got the special keys on my new wireless Micro Innovations keyboard working in Gentoo Linux by following the instructions for Setting Linux up to use the Cherry CyMotion Master Linux USB keyboard and by configuring KHotKeys to map the special keys to actions.

  • Run Windows 98 under Qemu

    See the following links:


Graphics Editing Tips

PDFs

  • Convert a TIFF image to a PDF document

    You can use the tiff2pdf command to convert a TIFF image to a PDF document. An example command for converting a TIFF to a PDF using Zip/Deflate compression is below.

    tiff2pdf tiff_input_file.tif -z -o pdf_output_file.pdf
  • Easily Rotate PDFs 90 Degrees using PDFjam

    PDFjam comes with a script called pdf90 which you can use to rotate PDF documents by 90 degreee increments. I use it to rotate PDF documents that are supposed to be landscape but were created in portrait mode.

Linux Kernel

Tips

  • Use /search in menuconfig
  • Remember to mount /boot before copying over new kernel.

Some of the options I enable when I compile the Linux Kernel

  • File systems --->
    • Network File Systems --->
      • <*> NFS file system support
      • <*> NFS server support
      • [ ] Provide NFS server over TCP support
  • Device Drivers --->
    • IEEE 1394 (FireWire) support --->
      • <M> OHCI-1394 Video support
      • <M> OHCI-DV I/O support
    • Ethernet (10 or 100Mbit) --->
      • <*> PCI NE2000 and clones support (see help)
      • <*> VIA Rhine support
    • Networking support --->
      • <*> PPP (point-to-point protocol) support
        • <*> PPP support for async serial ports
        • <*> PPP support for sync tty ports
      • Networking options --->
        • [*] Network packet filtering (replaces ipchains) --->
          • IP: Netfilter Configuration --->
            • IP: Netfilter Configuration --->
              • <M> FTP protocol support
              • <M> IRC protocol support

PCLinuxOS Tips

  • Get auto-starting of KDE screensavers working

    See my KDE Tips page.

  • Fix /dev/dsp sound permission denied errors

    When you add a user during the install of PCLinuxOS they only get added to their own group. To keep from getting permission denied errors about sound when multiple users are logged in just add each user to the audio group.

  • Install VMWare Player

    VMWare Player needs to be patched to be able to install on PCLinuxOS. Here's how to install it:

    1. Download and install VMWare player
    2. Download the vmware-config-1GB-lowmem.patch
    3. Patch vmware-config.pl:
      patch /usr/bin/vmware-config.pl /path/to/vmware/vmware-config-1GB-lowmem.patch
    4. Run vmware-config.pl

Tips for the LILO Boot Loader

  • Add option to boot into Windows on slave drive

    Do be able to boot into a windows partition you need an entry in you /etc/lilo.conf file like the following:

    other=/dev/hdb1
    label="windows"
    map-drive=0x80
    to=0x81
    map-drive=0x81
    to=0x80

Text Editing Tips


Git Tips

Useful git-related pages

{cms_module module="rss" url="http://feeds.delicious.com/rss/elijahlofgren/git" numbertoshow="50" descriptions="1"}

Elijah's Git cheatsheat:

How To Use git-svn to Easily Create NICE Patches for All Your SVN Commits

 

Checkout starting from an SVN repo:

svn log https://svn.perl.org/parrot/trunk|head
git-svn
fetch -r17048

Or:

elijahlofgren@kubuntu:~/www/silverstripe-gsoc$ mkdir sharethis
elijahlofgren@kubuntu:~/www/silverstripe-gsoc$ cd sharethis/
elijahlofgren@kubuntu:~/www/silverstripe-gsoc/sharethis$ git-svn init http://svn.silverstripe.com/open/modules/sharethis/trunk/
Initialized empty Git repository in .git/
elijahlofgren@kubuntu:~/www/silverstripe-gsoc/sharethis$ svn log http://svn.silverstripe.com/open/modules/sharethis/trunk/ --limit 1
------------------------------------------------------------------------
r39763 | lperera | 2007-08-08 17:56:25 -0500 (Wed, 08 Aug 2007) | 1 line

Changes to the README file
------------------------------------------------------------------------
elijahlofgren@kubuntu:~/www/silverstripe-gsoc/sharethis$ git-svn fetch -r39763
        A       images/icons/reddit.gif
...

        A       README
W: +empty_dir: javascript
W: +empty_dir: templates/Includes
W: +empty_dir: templates/Layout
r39763 = 797a01c72d170d45a7f884a61a231fa0852fe27b (git-svn)

Checked out HEAD:
  http://svn.silverstripe.com/open/modules/sharethis/trunk r39763
 

Download new revisions from SVN:

git-svn fetch 

Create a branch in order to push to http://repo.or.cz/w/silverstripe-elijah.git 

 git-checkout -b tiny_mce2

 git push git+ssh://repo.or.cz/srv/git/silverstripe-elijah.git tiny_mce2

Pust to git repo:

push git+ssh://repo.or.cz/srv/git

Committing (I use Cogito so I can use a commit-post hook for CIA)

Can use cg-commit, cg-diff, etc, like SVN. :) 

 

/silverstripe-elijah.git master
or
git push git+ssh://repo.or.cz/srv/git/silverstripe-elijah.git delete-fixes

Manually send a commit notification to CIA (if you have that setup in a post-commit hook):
./.git/hooks/post-commit 0c4a5bd941eba3d67cad67d6287b89677b775c24 delete-fixes

View commits:
git-log

Commit to SVN:
git-svn dcommit

List branches:
git branch

After creating a branch, merge it to master
git-merge delete-fixes

Then delete the branch:
git branch -d delete-fixes

Start web interface:
git-instaweb
 
More info:
http://utsl.gen.nz/talks/git-svn/intro.html#howto-fetch-head 

Fix "update-index --refresh: command returned error: 1" error

elijahlofgren@kubuntu:~/www/silverstripe-gsoc/cms$ git-svn rebase
.dotest/0002: needs update
...
.dotest/whitespace: needs update
update-index --refresh: command returned error: 1
 elijahlofgren@kubuntu:~/www/silverstripe-gsoc/cms$ git-log
commit ac3cf2659cab01afe99e5952c3501d6617b24af7
Author: Elijah Lofgren <elijahlofgren@kubuntu.(none)>
Date:   Thu Aug 16 12:49:03 2007 -0500

    Merge in SVN stuff

commit d7b488f81157b2143fa2c4a0d76a779af31dbcf3
Author: Elijah Lofgren <elijahlofgren@kubuntu.(none)>
Date:   Tue Aug 14 14:37:13 2007 -0500

    Fix silverstripe_version

commit 67096a4bd9dec9e4e06b49100fe94600373d8695
elijahlofgren@kubuntu:~/www/silverstripe-gsoc/cms$ git reset d7b488f81157b2143fa2c4a0d76a779af31dbcf3
lang/en_US.php: needs update

 elijahlofgren@kubuntu:~/www/silverstripe-gsoc/cms$ cg-commit --no-hooks -m "Fix git lang merge file"
M lang/en_US.php
Committed as d056fe23423ad7f62228c933f36ec1c759d81e95
elijahlofgren@kubuntu:~/www/silverstripe-gsoc/cms$ git-svn rebase
Current branch master is up to date.

Some commands  I used when working on SilverStripe: 

git-svn rebase (NOT git-svn fetch in order to actually apply new updates to local)
git-svn add
git push git+ssh://repo.or.cz/srv/git/silverstripe-elijah.git tiny_mce2
git-format-patch -o ~/silverstripe/patches/


CentOS 5 Tips

Hardware

Learn more about Linux

Comments

Comments? Questions? What do you think?

Add A Comment

Type in the letters/numbers in the picture below (spam prevention measure):

1 + 5 =
Your Name(*):
Comment(*):

Pages

Last Modified: June 29, 2008 04:00 PM

Back to Top

Previous page: Networking Tips for Ubuntu and Kubuntu

Next page: KDE Tips