Installing ipkg and Python on ASUS RT-N56U Router (Busybox)

Categories: Linux; Tagged with: ; @ May 15th, 2016 15:59
  1. enable ssh
  2. mount your usb drive – make sure it’s not vfat, you may need to format your disk:
    # mkfs.ext4 /dev/sda1
  3. update ipkg.sh:
    # mkdir -p /media/AiDisk_a1/opt
    # mount -o bind /media/AiDisk_a1/opt/ /opt/
    # mkdir -p /opt/tmp/ipkg
    # ipkg.sh update
  4. install ipkg:
    # ipkg.sh install ipkg-opt
  5. install python:
    ipkg install python27

Useful links:

ASUS RT-N56U or hardware NAT acceleration

Error Message:

Unpacking ipkg-opt...tar: can't create symlink from ./opt/bin/ipkg-opt to ipkg: Operation not permitted
tar: can't create symlink from ./opt/lib/libipkg.so to libipkg.so.0.0.0: Operation not permitted
tar: can't create symlink from ./opt/lib/libipkg.so.0 to libipkg.so.0.0.0: Operation not permitted
Done.
Configuring ipkg-opt...Done.

Make sure that your usb drive is not ‘vfat’

Enabling SSH on ASUS RT-N56U Router

Categories: Development NotesLinux; Tagged with: ; @ May 15th, 2016 15:36

the default firmware doesn’t provide the SSH feature, however, with the help of padavan‘s rt-n56u project, you may enable it:

This project aims to improve the rt-n56u and other supported devices on the software part, allowing power user to take full control over their hardware. This project was created in hope to be useful, but comes without warranty or support. Installing it will probably void your warranty. Contributors of this project are not responsible for what happens next.

How do I get set up?

What I did:

  1. download RT-N56U_3.4.3.9-099_base.trx
  2. login to the router setting dashboard, and upgrade the firmware by selecting the downloaded file.
  3. after couple minutes,  my router reset, I connect to the router via cable, and setup wifi. (you may try ‘1234567890’ to connect to your wifi network if you cannot connect to it directly)
  4. login to the router setting dashboard, you’ll find a new UI! navigate to: Advanced Settings > Administration > Services to setup your ssh server.  more details: https://bitbucket.org/padavan/rt-n56u/wiki/EN/CommonTips

Docker python hello world project

Categories: LinuxPython; Tagged with: ; @ January 26th, 2016 23:12

create a Dockerfile 
this image will install python and start a SimpleHTTPServer:

FROM ubuntu
ENV DEBIAN_FRONTEND noninteractive
CMD ["bash"]

RUN apt-get update
RUN apt-get install -y python

EXPOSE 8000
CMD python -m SimpleHTTPServer 8000

Build project
docker build -t myapp:latest .
run docker image
docker run -P myapp
-P for port forwarding:  Publish all exposed ports to random ports
check the web page
find port by:
docker ps -l

This project can be found here:
https://github.com/guoliang-dev/docker-hello-world-python

ssh to linux guest/virtual machine running virtualbox

Categories: Linux; Tagged with: ; @ January 23rd, 2016 16:07

Install / Start SSH in your guest Linux

sudo service ssh status

install open-ssh in case it’s not ready in your guest:

sudo apt-get install openssh-server

start the service if the service is stopped.

sudo service ssh start

Setup VirtualBox – port forwarding

virtualbox > edit settings for the guest vm:
network > port forwarding (e.g host 3022 -> guest 22)

SSH to the guest linux

ssh user@loalhost -p 3022

Grep

Categories: Linux; Tagged with: ; @ May 8th, 2014 21:50

guoliang@GDEV /tmp $ grep ‘hi’ test1.txt
hi
hihihihi

# Display line number
guoliang@GDEV /tmp $ grep -n ‘hi’ test1.txt
3: hi
4:hihihihi

# Count
guoliang@GDEV /tmp $ grep -c ‘hi’ test1.txt
2

# Case insensitive
guoliang@GDEV /tmp $ grep -n -i ‘hi’ test1.txt
1: HI
2: Hi
3: hi
4:hihihihi

# Search the whole word
guoliang@GDEV /tmp $ grep -n -w ‘hi’ test1.txt
3: hi

# Search recursively
guoliang@GDEV /tmp $ grep -n -w ‘hi’ -r  test*
test1.txt:3: hi
test3:2:hi

# Use grep in Pipes
GDEV tmp # find . -name ‘test*’ |xargs grep ‘hi’
./test1.txt: hi
./test1.txt:hihihihi
./test2:Hi, this is test2;
./test3:this is test 3
./test3:hi

Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.