incubus - an obsession in computing
  • rss
  • Home
  • Linux Apps
    • C&G 4250 Linux Extension
  • C&G 4240
    • Overview
    • Validate Program
    • Sort Program
    • Update / Merge Program
    • Report Program
    • Downloads
  • C&G 4250
    • Overview
    • Data Entry Program
    • Validate Program
    • Sort Program
    • Customer Update / Merge Program
    • Customer Report Program
    • Stock Update / Merge Program
    • Stock Report Program
    • Downloads
  • About
  • Contact

Compressed Hard Disk Image

inc | May 29, 2010 | 3:27 pm

The commands given below will allow you to create a compressed image of a complete hard disk. Under normal circumstances I would boot from a Linux Live-CD prior to performing these tasks:

dd if=source_disk | gzip > /destination.gz

For example /dev/sda is the source disk and /mnt/usb/image.gz is the destination:

dd if=/dev/sda | gzip > /mnt/usb/hd_image.gz

Then to restore the image:

gzip -dc /mnt/usb/hd_image.gz | dd of=/dev/sda

The format of these commands is very important and if used incorrectly will result in data loss, for which I take no responsibility.

—

Comments
No Comments »
Categories
Linux, Tips & Tricks
Tags
compressed, dd, hd, image
Comments rss Comments rss
Trackback Trackback

Useful Gentoo Aliases

inc | November 22, 2009 | 9:15 am

Just a quick post to save some time when updating your Gentoo system (Portage 2.2_rc51) , please note this is just a starting point, feel free to extend these.

nano ~/.bashrc
if [ -e /etc/bashrc ] ; then
 source /etc/bashrc
fi
alias esync='emerge --sync'
alias eupdate='emerge -uavDN --nospinner --quiet --keep-going --with-bdeps=y world'

To update your system just call the following two commands:

esync
eupdate

—

Comments
No Comments »
Categories
Linux, Tips & Tricks
Tags
alias, Gentoo
Comments rss Comments rss
Trackback Trackback

Linux – Merge AVI Files

inc | September 27, 2009 | 7:33 pm

Usually when I need to merge avi files I use avimerge (part of the transcode package), however recently the output of this suffered some serious audio sync issues. So along comes mencoder (part of the mplayer package):

mencoder -oac copy -ovc copy input_1.avi  input_2.avi -o output.avi

—

Comments
No Comments »
Categories
Linux, Tips & Tricks
Tags
avi, Linux, mencoder, merge
Comments rss Comments rss
Trackback Trackback

Remove OGA Office Not Genuine Notifications (KB949810)

inc | September 5, 2009 | 2:25 pm

The following slightly modified instructions were taken from http://www.mydigitallife.info, thank you MyDigitialLife.

To uninstall KB949810, just follow these steps:

  1. Go to C:\Windows\SoftwareDistribution\Download\8998da55d52b36c0e98ba016ddd50de0\ folder.
    Note: The directory may be different on your system, so if not located search for OGANotifier.cab.
  2. Extract OGANotifier.cab with 7-zip to get a file named OGANotifier.msi.
  3. Right click on OGANotifier.msi, and select Uninstall.
  4. Block the update from being installed again in Windows Update.

No more Office Genuine Advantage notification messages will be displayed on your system, regardless of the genuine status of the installed Office software, unless of course you chose to reinstall KB949810.

We do not agree or support the usage of pirated software, in order to purchase a genuine version of Microsoft Office please visit Amazon. This post is merely for information purposes.

—

Comments
1 Comment »
Categories
Tips & Tricks
Tags
KB949810, Microsoft, Office, Office Genuine Advantage
Comments rss Comments rss
Trackback Trackback

PPTP VPN / Ethernet ADSL (Gentoo/IPREDator)

inc | August 18, 2009 | 9:04 pm

I’ve had quite a bit of fun over the last couple of nights configuring a VPN connection using Gentoo Linux and the following simplified set-up:

   Home PC  <=> Ethernet ADSL Router <=> Internet <=>   VPN Server
192.168.1.x <=>      192.168.1.1     <=>          <=> xxx.xxx.xxx.xxx

Firstly ensure your kernel has ppp support (2.6.30 kernel configuration options):

# cd /usr/src/linux ; make menuconfig
Device Drivers ->
    Network device support ->
    [*]   PPP (point-to-point protocol) support
    <*>     PPP support for async serial ports
    <*>     PPP support for sync tty ports
    <*>     PPP Deflate compression
    <*>     PPP BSD-Compress compression
    <*>     PPP MPPE compression (encryption)
    <*>     PPP over Ethernet

Next emerge the ppp and pptpclient packages:

echo "net-dialup/ppp mppe-mppc" >> /etc/portage/package.use
emerge --ask --verbose ppp pptpclient

Once you have both ppp and pptpclient successfully installed upon your system edit the /etc/ppp/options.pptp file so that it resembles the one located below (only a few changes are required to this file):

Example options.pptp file for IPREDator

Next edit the /etc/ppp/chap-secrets file so that it resembles the one located below, be sure to add your IPREDator User name and Password to this file replacing the place holders contained within the example file):

Example chap-secrets file for IPREDator

Next create the /etc/ppp/peers/Ipredator file so that it resembles the one located below, again be sure to add your IPREDator User name to this file replacing the place holder contained within the example file):

Example Ipredator file for IPREDator

Now essentially all that is required is getting the routing set up correctly so that traffic flows to the correct place on the network. What I have below are some modified ip-up and ip-down scripts that may be used, some minor modifications maybe required to tailor the scripts to your specific network settings. These scripts are based upon those from the All Traffic Through Tunnel section of the PPTP Client website (many thanks to the original author as it pointed me in the right direction). I believe that both of these scripts should be set as being executable (chmod +x /etc/ppp/ip-up.d/60-ip-up-tunnel.sh).

ip-up script (/etc/ppp/ip-up.d/60-ip-up-tunnel.sh):

#!/bin/bash
# pppd ip-up script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# address of tunnel server
SERVER=$5

# gateway ip address (before tunnel - adsl router ip address)
GATEWAY="192.168.1.1"

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel startup
if [ "${CONNECTION}" = "Ipredator" ] ; then

 # direct tunneled packets to the tunnel server
 route del ${SERVER} dev ${TUNNEL}
 if [ "${GATEWAY}" = "" ] ; then
   route add -host ${SERVER} dev ${PRIMARY}
 else
   route add -host ${SERVER} gw ${GATEWAY} dev ${PRIMARY}
 fi

 # direct all other packets into the tunnel
 route del default ${PRIMARY}
 route add default dev ${TUNNEL}
fi

ip-down script (/etc/ppp/ip-down.d/60-ip-down-tunnel.sh):

#!/bin/bash
# pppd ip-down script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# server ip address (for tunnel)
SERVER=$5

# gateway ip address (before tunnel - adsl router ip address)
GATEWAY="192.168.1.1"

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel shutdown
if [ "${CONNECTION}" = "Ipredator" ] ; then

 # direct packets back to the original interface
 route del default ${TUNNEL}
 route del ${SERVER} dev eth0
 if [ "${GATEWAY}" = "" ] ; then
   route add default dev ${PRIMARY}
 else
   route add default gw ${GATEWAY} dev ${PRIMARY}
 fi
fi

Here is what the original routing table looks like, you will notice that all traffic is routed to the ADSL Gateway (in this case 192.168.1.1):

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
loopback        127.0.0.1       255.0.0.0       UG    0      0        0 lo
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

Here is what the routing table looks like when the tunnel is running, you will now notice that traffic to the VPN Server is routed to the ADSL Gateway (192.168.1.1), all local network traffic (192.168.1.xxx) is routed to the associated network interface (eth0), and that all other traffic is routed to the VPN interface (ppp0):

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
xxx.xxx.xxx.xxx 192.168.1.1     255.255.255.255 UGH   0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
loopback        127.0.0.1       255.0.0.0       UG    0      0        0 lo
default         *               0.0.0.0         U     0      0        0 ppp0

To start the connection open a terminal window and enter the following command:

pon Ipredator

To enable debug inorder to diagnose connection issues use the following command:

pon Ipredator debug dump logfd 2 nodetach

I hope this has been of some use to you, not only for configuring IPREDator but for other VPN connections that use the PPTP protocol..

—

Comments
13 Comments »
Categories
Linux, Tips & Tricks
Tags
ADSL, Gentoo, IPREDator, VPN
Comments rss Comments rss
Trackback Trackback

GNOME BitTorrent Client (GTK+) – P2

inc | May 5, 2009 | 6:35 pm

Following on from my post late last year, there is another excellent BitTorrent client for the GNOME Desktop, and that is Deluge. To be honest with you  I had a few issues with Transmission and download speed. These issues were resolved instantly by Deluge, and I have been using this as my preferred BitTorrent Client for several months now.

Deluge

Currently at version 1.1.7 it should service all your BitTorrent needs (emerge -av deluge). The only negative I have with this application is that of high CPU usage.

Update: The high CPU usage has been resolved with version 1.1.8, seems it was due to displaying the torrent speeds on the title bar of the main application window. So either upgrade to 1.18 or disable this option within the configuration options window.

Update: Another good feature of this application is the ability to import block lists into it, such as the level1.gz from http://blocklistpro.com/. This helps reduce nasties connecting to you while you are downloading your favourite Linux Distribution (Gentoo Minimal x86 / Gentoo LiveCD i686).

—

Comments
No Comments »
Categories
Linux, Tips & Tricks
Tags
GNOME, GTK, Linux BitTorrent Client
Comments rss Comments rss
Trackback Trackback

Spawning a Process (QNX vs Linux)

inc | October 16, 2008 | 7:43 am

Well work has been keeping me very busy over the last month or so, and will continue to do so way into Christmas. Any way here is a little QNX to Linux porting tip (nothing major)…

When using QNX it was quite easy to start another process from your code:

pid = spawnlp ( P_NOWAIT, "app_name", "app_name", "arg1", "arg_2", ..., NULL);

However under Linux the spawn() family of functions does not exist, so we have to use the fork() and exec() functions:

switch ((pid = fork()))
{ case  0:
    if ((execlp ( "app_name", "app_name",  "arg_1", "arg_2", ..., NULL) == -1))
        _exit(1);
    break;
  case -1:
    break;
}

Also you must also be aware that your process may continue in the running state, so if you wish to make use of the newly forked process you may wish to put a forced delay/yield within the parent process to help produce a context switch to the newly created child process. You will also have to handle the SIGCHLD signal too (signal (SIGCHLD, SIG_IGN), will have the same effect as the QNX NO Zombie option).

—

Comments
No Comments »
Categories
Linux, Tips & Tricks
Comments rss Comments rss
Trackback Trackback

Linked Lists (Diagrams)

inc | September 22, 2008 | 8:00 pm

OK here is a blast from the past … some diagrams that may help a little with the linked lists and their manipulation. These were originally drawn / written when I was studying for the City & Guilds 4250 course, I hope someone someday finds them of some use.

Insertion at the start of the List:
* Before Insertion into List
* After Insertion into List

Insertion at the end of the List:
* Before Insertion into List
* After Insertion into List

Insertion in the middle of the List:
* Before Insertion into List
* After Insertion into List

Deletion from the start of the List:
* Before Deletion from List
* After Deletion from List

Deletion from the end of the List:
* Before Deletion from List
* After Deletion from List

Deletion from the middle of the List:
* Before Deletion from List
* After Deletion from List

Comments
No Comments »
Categories
Linux, Tips & Tricks
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Search @incubus

Recent Posts

  • Compressed Hard Disk Image
  • It’s been along time …
  • T209 ECA Result
  • Old Linux Discs…
  • Panasonic CF-U1 / 2D Barcode Imager
  • Useful Gentoo Aliases
  • Hosting Provider Changed.
  • Linux – Merge AVI Files
  • Coders at Work
  • Remove OGA Office Not Genuine Notifications (KB949810)

Links

  • Demonoid
  • Engadget
  • Gentoo Linux
  • Gentoo Planet
  • Gentoo Universe
  • GNOME
  • GNOME Planet
  • ISO Hunt
  • OS News
  • Piratebay

Navigation

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Archives

  • May 2010 (1)
  • February 2010 (1)
  • December 2009 (3)
  • November 2009 (2)
  • September 2009 (4)
  • August 2009 (1)
  • July 2009 (1)
  • May 2009 (2)
  • April 2009 (1)
  • February 2009 (2)
  • January 2009 (1)
  • December 2008 (1)
  • November 2008 (1)
  • October 2008 (3)
  • September 2008 (7)
  • August 2008 (16)

Categories

  • 4240 (1)
  • 4250 (1)
  • Code (8)
  • Linux (29)
  • ODB2 (2)
  • Open University (6)
  • Tips & Tricks (13)
  • Uncategorized (5)

Stats

Visits Today: 12
rss Comments rss design by jide powered by Wordpress get firefox
© Copyright 1999-2010 @incubus. All Rights Reserved. All trademarks acknowledged.
incubus.co.uk || incubus.mobi || rankinstine.co.uk