April 2

Linux: Resize a linux image file

To resize your Debian IMG file – instructions are for people with linux computers or laptops:

Copy the ‘debian.img’ image file from your Phone’s SD card (in sdcard/debian) to your linux desktop.

Open a terminal on your linux computer and ‘su’ so you are root.

change directory to the desktop in unbuntu’s case it’s here, we do this so we can see whats going on easily:

cd /home/user/Desktop

create an empty image file: (the 3500999999 refers to the size – this one is 3.5 GB, basically take the first 4 digits and thats how many megabytes the image will be)

dd if=/dev/zero of=debian2.img seek=3500999999 bs=1 count=1

Your new image file is called debian2.img

Now do (you are still on your desktop linux machine here):

mkfs.ext2 -F debian2.img

Mount the 2 images (the old one and new empty one)

mkdir debian
mkdir debian2
mount -o loop debian.img debian
mount -o loop debian2.img debian2

Copy the contents of the old image into the new:

cd /home/user/Desktop/debian/

cp -r -f –preserve * /home/user/Desktop/debian2

Unmount files

umount debian
umount debian2

(sometimes this doesn’t work – so simply reboot)

e2fsck -F debian2

Once that’s done

Back to your linux computer desktop:

As root (su):

Delete the 2 folders debian and debian2

rm -r -f debian
rm -r -f debian2

delete your old image:

rm debian.img

rename the new image:

mv debian2.img debian.img

change permissions:

chmod a+x debian.img
chmod 777 debian.img

Then copy the newly created image into your phones /sdcard/debian folder (overwrite the original).

Finally on your phone boot debian shell as normal and at the localhost$ prompt do:

cd /var/lib/dpkg/updates

rm -r -f *

then

dpkg –configure -a (may take a few minutes, ignore the errors)

This gives you a 3.5GB image instead of the 720mb original image.

Category: Linux | Comments Off on Linux: Resize a linux image file
March 21

Linux: RDP on Linux with Windows 2008 Remote Desktop with Network Level Authentication

Setting up a RDP on Linux with Windows 2008 Remote Desktop with Network Level Authentication

The following may be out of installation order:

Installation:
Download and install libfreerpd
sudo dpkg -i libfreerdp1_1.0.1-1_amd64.deb

Download and install freerdp version 1.0 or later
sudo dpkg -i freerdp-x11_1.0.1-1_amd64.deb

Download and install the Open Source rdpdesktop
http://rdpdesk.com/distribs/rdpdesk_3.3.0-0_amd64.deb
sudo dpkg -i rdpdesk_3.3.0-0_amd64.deb

Use:
First setup your authentication certificates
/usr/sbin/xfreerpd -u username -d domainname servername
You will be prompted to enter your Domain Password
You will be prompted to trust the certificate

Ignore any errors. If it fails run xfreerdp again and it will authentcate now that you have the servers Thumbprint.

The xfreerdp process will need ran once for each server from terminal that you are going to connect to.

Run RDPDESKTOP software and setup your server connections.
Be sure to choose “RDP Protocol (freerdp) to use the Network Authentication that you previously setup.

Category: Linux | Comments Off on Linux: RDP on Linux with Windows 2008 Remote Desktop with Network Level Authentication
March 21

Linux: Ubuntu – How to keep programs from launching maximized?

In Ubuntu 11.10:

Install ccsm if you don’t already have it (bizarrely, it’s not installed by default)
Run it
Go to Desktop
Click Ubuntu Unity Plugin
Go to the Experimental tab

Set the Auto-maximize value to 100% to completely disable it, or just to a higher percentage if you like the behavior but the default 75% is the wrong value for you.

Category: Linux | Comments Off on Linux: Ubuntu – How to keep programs from launching maximized?
March 16

Linux: Centos/Red Hat – Configuring the network from the command line

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:

/etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
/etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

To edit/create first NIC file, type command:
# vi ifcfg-eth0
Append/modify as follows:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes

Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65

Save and close the file. Restart networking:
# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS Server as follows:
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:
$ ping 10.0.80.12
Output:

PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms

You can also check for Internet connectivity with nslookup or host command:
$ nslookup cyberciti.biz
Output:

Server: 10.0.80.11
Address: 10.0.80.11#53
Non-authoritative answer:
Name: cyberciti.biz
Address: 75.126.43.232

You can also use host command:
$ host nixcraft.in
Output:

nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.

Category: Linux | Comments Off on Linux: Centos/Red Hat – Configuring the network from the command line