Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, September 27, 2009

Disassembly in ubuntu

Disassembly in ubuntu,

solution: use dissy
sudo apt-get install dissy

eg:
gcc -0 hello hello.c
dissy hello

Friday, September 25, 2009

scenario: ubuntu 9.04, FF, amule

(1.) Launch Firefox.

(2.) Then, insert about:config in the address bar. Right click on the list, select New, then Boolean; insert network.protocol-handler.external.ed2k as Preference Name and true as Value.

(3.) Now another right click, select New and String; insert network.protocol-handler.app.ed2k as Preference Name and /usr/bin/ed2k (or path to where the file is installed on you system) as Value.

(4.) Restart Firefox.

Compiling Kernel Module in Ubuntu 9.04

scenario: compiling module
  1. ubuntu 9.04
  2. kernel 2.6.28-15-generic
sample code:
#include
#include /* Needed by all modules */
#include /* Needed for KERN_INFO */
#include /* Needed for the macros */

static int __init hello_start(void)
{
printk(KERN_INFO "Loading hello module...\n");
printk(KERN_INFO "Hello world\n");
return 0;
}

static void __exit hello_end(void)
{
printk(KERN_INFO "Goodbye Mr.\n");
}

module_init(hello_start);
module_exit(hello_end);

instruction guide:
sudo apt-get install linux-headers-`uname -r`
vi hello.c
copy the code into it
vi Makefile
insert
obj-m := nothing.o
in the command line type
make -C /lib/modules/`uname -r`/build M=`pwd` modules



Wednesday, September 23, 2009

Transfer file through ssh

Scenario: having a server and a client. need to transfer file between these two host
server name: remote_server
client: my_client

to transfer file from server to client
open local terminal:
scp user@remote_server:myfile ~/mydir

send a local file, a.file
me@remote-server.com:~$ sendfile localfile remotefile


Ubuntu Internet Sharing Connection

Scenario: having multiple client, one switch and one eeepc that can connect to the internet through wireless connection.

At Host (the eeepc):
sudo gedit /etc/network/interfaces

copy these
auto eth0
iface eth0 inet static
address 10.8.16.1
netmask 255.255.255.0
broadcast 10.8.16.0
network 10.8.16.0

gsku gedit /etc/sysctl.conf
net.ipv4.conf.default.forwarding=1
sudo apt-get install dhcp3-server
gksu gedit /etc/dhcp3/dhcpd.conf

copy these:
ddns-update-style none;
option domain-name "mynetwork";
option domain-name-servers Nameserver1, Nameserver2;
option routers 10.8.16.1;

default-lease-time 42300;
max-lease-time 84600;
authoritative;

log-facility local7;

subnet 10.8.16.0 netmask 255.255.255.0 {
range 10.8.16.50 10.8.16.150;
}

Nameserver can be found from "cat /etc/resolv.conf"
gksu gedit /etc/default/dhcp3-server
INTERFACES="eth0"

enable ip packet forwarding:
gksu gedit /etc/rc.local
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o ra0 -j MASQUERADE

Wednesday, July 8, 2009

adobe flash 10 on firefox, ubuntu 9.04

sudo apt-get remove mozilla-plugin-gnash flashplugin-nonfree swfdec-mozilla

wget -c http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.deb

sudo dpkg -i install_flash_player_10_linux.deb

source

Sunday, June 14, 2009

repairing grub after reinstalling windows

using ubunt, can't boot ubuntu after installing windows server 2008.  found a few sites.  This article helps me to solve the problem. below is the summary of the steps.

after booting up from live cd

  1. sudo grub

  2. find /boot/grub/stage1

  3. find /grub/stage1

  4. grub> root (hdX,Y)

  5. grub> setup (hd0)

  6. grub> quit