ascii image


0010101000011111101001101010000010011000
1110101110110101011011111010010010001011
0001011100011101111001010011010010111110
0000010111101001100000110011101100001000
0011000000111010001111111000100110000001
1010110110000000000001011001000110001010
0101100010101100000100000010100100010101
0001011001011101100011000101110111101110
0110010100110100111101110100110011111101
0010111100110011010010110010101111011011
0100000000001001001011000010110100101001
1101000111100000110111011100110111000010
1111110001111111101101001010000111101100
0010110000100000111011000000101100010110
0101111000011100111010000000011111101111
0010010011110010011101001000110101000101
0000000001000100001111111100111010001111

Wednesday, 25 January 2017

Brute forcing hashes on ssh known_hosts

While developing on Fujitsu K5, i realised that i was filling my known_hosts with IPs.
In my ssh_config now, for the address spaces i dont need:
  UserKnownHostsFile=/dev/null
  StrictHostKeyChecking=no
Then, it says i adds to known_hosts, but it doesn't
$ ssh -F k5_ssh_config 10.77.1.3
Warning: Permanently added '62.60.42.151' (ECDSA) to the list of known hosts.
Warning: Permanently added '10.77.1.3' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-61-generic x86_64)

  Here is my gist:

Installing riot.im client on Ubuntu

have fun :)

sudo add-apt-repository 'deb https://riot.im/packages/debian/ trusty main'

wget -qO - https://riot.im/packages/debian/repo-key.asc | sudo apt-key add -

sudo apt-get update

sudo apt-get --show-progress install riot-web

Sunday, 7 August 2016

DevStack, OpenVSwitch and LXC

While playing with DevStack inside a LXC container, i'd run into a a lot of issues where once the ./stack.sh reached the neutron stage it failed with odd errors.
2016-08-04 19:59:44.439 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.450 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.462 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.473 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.485 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.496 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.508 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.519 | ovs-ofctl: br-int is not a bridge or a socket
and/or
mmod: ERROR: Module bridge is in use by: ebtable_broute
 * removing bridge module
Sat Aug  6 08:33:16 UTC 2016:start --system-id=random
 * Starting ovsdb-server
 * Configuring Open vSwitch system IDs
modprobe: ERROR: could not insert 'openvswitch': Operation not permitted
 * Inserting openvswitch module
rmmod: ERROR: Module bridge is in use by: ebtable_broute
 * removing bridge module
 * Enabling remote OVSDB managers
These above errors come from the underlying host of LXC not having the right kernel modules loaded. So you are going to need to install a few things on the host: Open virtual switch and ethernet bridge tables (firewall)
sudo apt-get install ebtables openvswitch-common
Then update your /etc/modules to load things into the kernel
# openstack
bonding
q8021q
openvswitch
ebtables
Force them manually
sudo modprobe openvswitch
sudo modprobe ebtables
Now Devstack with Neutron installs fine. Yay!
My devstack local.conf - Mitaka, Heat and Neutron
[[local|localrc]]

DEST=/opt/stack

ADMIN_PASSWORD=MySecretDevPass
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

# fixed DHCP via  /etc/lxc/dnsmasq-hosts.conf via /etc/default/lxc-net on LXC host side
# https://askubuntu.com/questions/446831/how-to-let-built-in-dhcp-assign-a-static-ip-to-lxc-container-based-on-name-not
HOST_IP=10.0.3.10

# v3 KeyStone API only
ENABLE_IDENTITY_V2=False

PRIVATE_NETWORK_NAME=priv_net
PUBLIC_NETWORK_NAME=ext_net

#-----------------------------
# Devstack configurations
#-----------------------------
LOGDIR=$DEST/logs
SCREEN_LOGDIR=$LOGDIR
SCREEN_HARDSTATUS="%{= rw} %H %{= wk} %L=%-w%{= bw}%30L> %n%f %t*%{= wk}%+Lw%-17< %-=%{= gk} %y/%m/%d %c"
LOGFILE=$LOGDIR/devstack.log
LOGDAYS=1
LOG_COLOR=True
VERBOSE=True

#
# Modules
#

# Load the external LBaaS plugin.
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://git.openstack.org/openstack/octavia


# Pre-requisite
ENABLED_SERVICES=rabbit,mysql,key

# Horizon
ENABLED_SERVICES+=,horizon

# Nova
ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-cond,n-sch

# Glance
ENABLED_SERVICES+=,g-api,g-reg

#Enable heat services
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
#fedora images from F20 contain the heat-cfntools package which is required for some heat functionality.
#IMAGE_URLS+=","https://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-24-1.2.x86_64.qcow2"
# download from local server to speed up stacking
IMAGE_URLS+=","http://192.168.0.4/openstack/Fedora-Cloud-Base-24-1.2.x86_64.qcow2

# Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta

# Cinder
ENABLED_SERVICES+=,c-api,c-vol,c-sch

# Enable LBaaS v2
##ENABLED_SERVICES+=,q-lbaasv2
##ENABLED_SERVICES+=,octavia,o-cw,o-hk,o-hm,o-api # TODO octavia fails

DevStack, OpenVSwitch and LXC

While playing with DevStack inside a LXC container, i'd run into a a lot of issues where once the ./stack.sh reached the neutron stage it failed with odd errors.
2016-08-04 19:59:44.439 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.450 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.462 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.473 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.485 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.496 | ovs-ofctl: br-int is not a bridge or a socket
2016-08-04 19:59:44.508 | ovs-ofctl: br-ex is not a bridge or a socket
2016-08-04 19:59:44.519 | ovs-ofctl: br-int is not a bridge or a socket
and/or
mmod: ERROR: Module bridge is in use by: ebtable_broute
 * removing bridge module
Sat Aug  6 08:33:16 UTC 2016:start --system-id=random
 * Starting ovsdb-server
 * Configuring Open vSwitch system IDs
modprobe: ERROR: could not insert 'openvswitch': Operation not permitted
 * Inserting openvswitch module
rmmod: ERROR: Module bridge is in use by: ebtable_broute
 * removing bridge module
 * Enabling remote OVSDB managers
These above errors come from the underlying host of LXC not having the right kernel modules loaded. So you are going to need to install a few things on the host: Open virtual switch and ethernet bridge tables (firewall)
# apt-get install ebtables openvswitch-common
Then update your /etc/modules to load things into the kernel
# openstack
bonding
q8021q
openvswitch
ebtables
Force them manually
# modprobe openvswitch
# modprobe ebtables
Now Devstack with Neutron installs fine. Yay!
My devstack local.conf - Mitaka, Heat and Neutron
[[local|localrc]]

DEST=/opt/stack

ADMIN_PASSWORD=MySecretDevPass
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

# fixed DHCP via  /etc/lxc/dnsmasq-hosts.conf via /etc/default/lxc-net on LXC host side
# https://askubuntu.com/questions/446831/how-to-let-built-in-dhcp-assign-a-static-ip-to-lxc-container-based-on-name-not
HOST_IP=10.0.3.10

# v3 KeyStone API only
ENABLE_IDENTITY_V2=False

PRIVATE_NETWORK_NAME=priv_net
PUBLIC_NETWORK_NAME=ext_net

#-----------------------------
# Devstack configurations
#-----------------------------
LOGDIR=$DEST/logs
SCREEN_LOGDIR=$LOGDIR
SCREEN_HARDSTATUS="%{= rw} %H %{= wk} %L=%-w%{= bw}%30L> %n%f %t*%{= wk}%+Lw%-17< %-=%{= gk} %y/%m/%d %c"
LOGFILE=$LOGDIR/devstack.log
LOGDAYS=1
LOG_COLOR=True
VERBOSE=True

#
# Modules
#

# Load the external LBaaS plugin.
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://git.openstack.org/openstack/octavia


# Pre-requisite
ENABLED_SERVICES=rabbit,mysql,key

# Horizon
ENABLED_SERVICES+=,horizon

# Nova
ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-cond,n-sch

# Glance
ENABLED_SERVICES+=,g-api,g-reg

#Enable heat services
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
#fedora images from F20 contain the heat-cfntools package which is required for some heat functionality.
#IMAGE_URLS+=","https://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-24-1.2.x86_64.qcow2"
# download from local server to speed up stacking
IMAGE_URLS+=","http://172.30.5.67/openstack/Fedora-Cloud-Base-24-1.2.x86_64.qcow2

# Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta

# Cinder
ENABLED_SERVICES+=,c-api,c-vol,c-sch

# Enable LBaaS v2
##ENABLED_SERVICES+=,q-lbaasv2
##ENABLED_SERVICES+=,octavia,o-cw,o-hk,o-hm,o-api # TODO octavia fails

Thursday, 12 November 2015

lxd - container wont start due to fork error


# lxc start test-centos-6 

error: Error calling 'lxd forkstart test-centos-6 /var/lib/lxd/containers /var/log/lxd/test-centos-6/lxc.conf': err='exit status 1'
Try `lxc info --show-log test-centos-6` for more info
Check the logs
# lxc info --show-log test-centos-6 | egrep "ERROR"
            lxc 1447352472.614 ERROR    lxc_utils - utils.c:setproctitle:1461 - Invalid argument - setting cmdline failed
            lxc 1447352472.675 ERROR    lxc_sync - sync.c:__sync_wake:62 - sync wake failure : Broken pipe
            lxc 1447352472.675 ERROR    lxc_start - start.c:__lxc_start:1192 - failed to spawn 'test-centos-6'
Basically, i had set the max memory for the container to 4GB.
with
lxc config set test-centos-6 limits.memory 4096
Only thing it is in bytes not MB
This fixes it.
lxc config set test-centos-6 limits.memory 4096000000
Check the container once started
# lxc start test-centos-6

# lxc exec test-centos-6 /bin/bash

[root@test-centos-6 ~]# free -g
             total       used       free     shared    buffers     cached
Mem:             3          0          3          0          0          0
-/+ buffers/cache:          0          3 
Swap:            7          0          7 

Tuesday, 30 June 2015

Ubuntu 14.04 - window buttons to the right


Read this.

https://askubuntu.com/a/451330

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install gnome-session-flashback

log out, and select gnome flashback as the Desktop

now run this

gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close' 

a bit more saner :)

Changing Ubuntu 14.04 scroll bar colors


Install  gnome-tweak-tool, this will sort out Firefox etc.

$ sudo apt-get install gnome-tweak-tool

Next fix GTK 3.0

Make sure you pick the right theme :)  current as of June 2015

$ sudo gedit /usr/share/themes/Ambiance/gtk-3.0/gtk-widgets.css


Add the stepper buttons

/* search for the stepper and change the size */

-GtkRange-stepper-size: 20;   /* was 13 */

/* enable the stepper */

/*************
 * scrollbar *
 *************/
.scrollbar,
.scrollbar.vertical {
    -GtkScrollbar-has-backward-stepper: 1;   /* 1 = enable */
    -GtkScrollbar-has-forward-stepper: 1;
    -GtkRange-slider-width: 20;   /* change width, was 13 */




/* change the colors */

/* VERTICAL */

.scrollbar.slider,
.scrollbar.slider:hover,
.scrollbar.button,
.scrollbar.slider.vertical,
.scrollbar.slider.vertical:hover,
.scrollbar.button.vertical {
    border-width: 1px;
    border-style: solid;
    border-color: shade (@bg_color, 0.86);
    background-image: -gtk-gradient (linear, left top, right top,
                                     from (shade (#00BFFF, 1.08)),   /* was @button_bg_color */
                                     color-stop (0.5, #00BFFF),      /* was @button_bg_color */
                                     to (shade (#00BFFF, 0.94)));    /* was @button_bg_color */



/* HORIZONTAL */

.scrollbar.slider.horizontal,
.scrollbar.slider.horizontal:hover,
.scrollbar.button.horizontal {
    background-image: -gtk-gradient (linear, left top, left bottom,
                                     from (shade (#00BFFF, 1.08)),    /* was @button_bg_color */
                                     color-stop (0.5, #00BFFF),       /* was @button_bg_color */
                                     to (shade (#00BFFF, 0.94)));     /* was @button_bg_color */


Saturday, 27 September 2014

Stopping the network manager and applet from running in Ubuntu Cinnamon

Cinnamon 2.2.13
Ubuntu 14.04


# do not start network manager

echo manual > /etc/init/network-manager.override


# remove network manager applet from cinnamon dock panel

vi /usr/share/cinnamon-session/sessions/cinnamon.session

#RequiredComponents=cinnamon;cinnamon-settings-daemon;cinnamon-screensaver;nemo-autostart;nm-applet;
RequiredComponents=cinnamon;cinnamon-settings-daemon;cinnamon-screensaver;nemo-autostart;

# reboot

Thursday, 3 April 2014

Mapping ATA device numbers to hard drive device names on Ubuntu


A nice little one liner:

# ls -l /sys/block/sd* | sed 's/.*\(sd.*\) -.*\(host.*\)\/t.*/\2 => \1/'
host0 => sda
host1 => sdb
host6 => sdc
host7 => sdd
host8 => sde
host9 => sdf

therefore

host0 => ata0 => sda


Which is the same with this: 

The first number in the [] brackets shows the ata number


# lsscsi --long
[0:0:0:0]    disk    ATA      WDC WD40EZRX-00S 80.0  /dev/sda
  state=running queue_depth=31 scsi_level=6 type=0 device_blocked=0 timeout=30
[1:0:0:0]    disk    ATA      WDC WD40EZRX-00S 80.0  /dev/sdb
  state=running queue_depth=31 scsi_level=6 type=0 device_blocked=0 timeout=30
[6:0:0:0]    disk    ATA      WDC WD20EZRX-00D 80.0  /dev/sdc
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[7:0:0:0]    disk    ATA      WDC WD20EZRX-00D 80.0  /dev/sdd
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[8:0:0:0]    disk    ATA      SAMSUNG HD103UJ  1AA0  /dev/sde
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[9:0:0:0]    disk    ATA      SAMSUNG HD103UJ  1AA0  /dev/sdf
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30

Friday, 28 March 2014

more hidden Draytek commands

> sys version systeminfo
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A

============== CPU usage ===============
CPU speed : 333 MHz
CPU1 speed: 333 MHz
DDR speed : 166 MHz
CPU usage :  0 %
========= Linear Memory usage ============
Dynamic memory usage : 56 % (17306K/31483K)
         Free memory : 13153K(13469168 bytes)
 DSP occupied memory : 1024K(1048576 bytes)
  Total memory usage : 79 % (51358K/64512K)
Idle task idle time : 0 sec



> sys version wdtdbg   
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A

WDT debug flag is OFF.



> sys version osswdbg
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A

OS content switch debug flag is OFF.


> sys version russia
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Russia fw: No
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A


> sys version ostaskinfo%^&*
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A

-----OS Task Information (Internal debug only) -------------------
 P#=116,Sts=1,Dly=0024, SP=80981348 Name:(void(*)(void))if_task_wan
   Stack: top=80981440, btm=8097d844, size=15356
          now used=   248, now free= 15108(98%)
          max used=   248, min free= 15108(98%)
 P#=118,Sts=1,Dly=005e, SP=80988610 Name:(void(*)(void))httpd_main
   Stack: top=80988c58, btm=8098505c, size=15356
          now used=  1608, now free= 13748(89%)
          max used=  8276, min free=  7080(46%)
 P#=119,Sts=1,Dly=0120, SP=8098c184 Name:ap_task
   Stack: top=8098c864, btm=80988c68, size=15356
          now used=  1760, now free= 13596(88%)
          max used=  2580, min free= 12776(83%)
 P#=120,Sts=1,Dly=0007, SP=80990398 Name:(void(*)(void))if_task_bridge
   Stack: top=80990470, btm=8098c874, size=15356
          now used=   216, now free= 15140(98%)
          max used=   216, min free= 15140(98%)
 P#=121,Sts=0,Dly=000a, SP=80997ba8 Name:timer_task
   Stack: top=80997c88, btm=8099408c, size=15356
          now used=   224, now free= 15132(98%)
          max used=  2268, min free= 13088(85%)
 P#=122,Sts=1,Dly=0019, SP=809aa44c Name:relay_task
   Stack: top=809aa8c4, btm=809a6cc8, size=15356
          now used=  1144, now free= 14212(92%)
          max used=  1144, min free= 14212(92%)
 P#=123,Sts=1,Dly=03de, SP=809ade20 Name:RemoteCapiTask
   Stack: top=809ae4d0, btm=809aa8d4, size=15356
          now used=  1712, now free= 13644(88%)
          max used=  1712, min free= 13644(88%)
 P#=135,Sts=1,Dly=0000, SP=8099b6ec Name:CM_Task
   Stack: top=8099b894, btm=80997c98, size=15356
          now used=   424, now free= 14932(97%)
          max used=  3396, min free= 11960(77%)
 P#=136,Sts=1,Dly=0093, SP=8099edf8 Name:PPTP_Task
   Stack: top=8099f4a0, btm=8099b8a4, size=15356
          now used=  1704, now free= 13652(88%)
          max used=  2604, min free= 12752(83%)
 P#=137,Sts=1,Dly=000b, SP=809a2a04 Name:IPv6_Task
   Stack: top=809a30ac, btm=8099f4b0, size=15356
          now used=  1704, now free= 13652(88%)
          max used=  4268, min free= 11088(72%)
 P#=138,Sts=1,Dly=005b, SP=809a6828 Name:sstp_task
   Stack: top=809a6cb8, btm=809a30bc, size=15356
          now used=  1168, now free= 14188(92%)
          max used=  1168, min free= 14188(92%)
*P#=139,Sts=0,Dly=0000, SP=809b1604 Name:(void (*)(void))tnsfunc
   Stack: top=809b20dc, btm=809ae4e0, size=15356
          now used=  2776, now free= 12580(81%)
          max used=  3772, min free= 11584(75%)
*P#=140,Sts=0,Dly=0000, SP=80984f3c Name:DSL_DRV_AutobootThreadMain
   Stack: top=8098504c, btm=80981450, size=15356
          now used=   272, now free= 15084(98%)
          max used=  2840, min free= 12516(81%)
 P#=141,Sts=1,Dly=0024, SP=809b9344 Name:dhcp_daemon
   Stack: top=809b98f4, btm=809b5cf8, size=15356
          now used=  1456, now free= 13900(90%)
          max used=  1468, min free= 13888(90%)
 P#=142,Sts=1,Dly=0000, SP=809bcf00 Name:ike_daemon
   Stack: top=809bd500, btm=809b9904, size=15356
          now used=  1536, now free= 13820(89%)
          max used=  1536, min free= 13820(89%)
 P#=143,Sts=1,Dly=0008, SP=809c0e54 Name:ftpstart
   Stack: top=809c110c, btm=809bd510, size=15356
          now used=   696, now free= 14660(95%)
          max used=  1504, min free= 13852(90%)
 P#=144,Sts=1,Dly=0019, SP=809c4ae8 Name:telnetd_main
   Stack: top=809c4d18, btm=809c111c, size=15356
          now used=   560, now free= 14796(96%)
          max used=  1356, min free= 14000(91%)
 P#=145,Sts=1,Dly=0000, SP=809c8384 Name:sshd_main
   Stack: top=809c8924, btm=809c4d28, size=15356
          now used=  1440, now free= 13916(90%)
          max used=  1740, min free= 13616(88%)
 P#=146,Sts=1,Dly=0000, SP=809cc450 Name:gena_task
   Stack: top=809cc530, btm=809c8934, size=15356
          now used=   224, now free= 15132(98%)
          max used=   224, min free= 15132(98%)
 P#=147,Sts=1,Dly=0008, SP=809d005c Name:soap_task
   Stack: top=809d013c, btm=809cc540, size=15356
          now used=   224, now free= 15132(98%)
          max used=   224, min free= 15132(98%)
 P#=148,Sts=1,Dly=0024, SP=809d36a0 Name:RIP_Task
   Stack: top=809d3d48, btm=809d014c, size=15356
          now used=  1704, now free= 13652(88%)
          max used=  2388, min free= 12968(84%)
 P#=149,Sts=1,Dly=0000, SP=809d7834 Name:sntp_task
   Stack: top=809d7954, btm=809d3d58, size=15356
          now used=   288, now free= 15068(98%)
          max used=  3400, min free= 11956(77%)
 P#=150,Sts=1,Dly=005f, SP=809daea0 Name:LPD_Task
   Stack: top=809db560, btm=809d7964, size=15356
          now used=  1728, now free= 13628(88%)
          max used=  1728, min free= 13628(88%)
 P#=151,Sts=1,Dly=0000, SP=809df06c Name:usb_event_task
   Stack: top=809df16c, btm=809db570, size=15356
          now used=   256, now free= 15100(98%)
          max used=  1908, min free= 13448(87%)
 P#=152,Sts=1,Dly=0000, SP=809e2c78 Name:usb_stor_control_thread
   Stack: top=809e2d78, btm=809df17c, size=15356
          now used=   256, now free= 15100(98%)
          max used=   256, min free= 15100(98%)
 P#=153,Sts=1,Dly=011e, SP=809e688c Name:Common_Mail_Task
   Stack: top=809e6984, btm=809e2d88, size=15356
          now used=   248, now free= 15108(98%)
          max used=   248, min free= 15108(98%)
 P#=154,Sts=1,Dly=0022, SP=809e9f68 Name:snmpmain
   Stack: top=809ea590, btm=809e6994, size=15356
          now used=  1576, now free= 13780(89%)
          max used=  2240, min free= 13116(85%)
 P#=155,Sts=1,Dly=0008, SP=809ee0ac Name:lte_connection_thread
   Stack: top=809ee19c, btm=809ea5a0, size=15356
          now used=   240, now free= 15116(98%)
          max used=   240, min free= 15116(98%)
*P#=161,Sts=0,Dly=0000, SP=80993dd4 Name:(void(*)(void))if_task_lan
   Stack: top=8099407c, btm=80990480, size=15356
          now used=   680, now free= 14676(95%)
          max used=  3132, min free= 12224(79%)
 P#=162,Sts=0,Dly=0024, SP=818d6f74 Name:PMU_Task
   Stack: top=818d7048, btm=818d6048, size=4096
          now used=   212, now free=  3884(94%)
          max used=   244, min free=  3852(94%)
*P#=163,Sts=0,Dly=0000, SP=818d8aec Name:IdleTask
   Stack: top=818d9060, btm=818d7060, size=8192
          now used=  1396, now free=  6796(82%)
          max used=  1704, min free=  6488(79%)
Opened task no. = 31





> sys version osstackinfo%^&*
Router Model: Vigor2830n    Version: 3.6.4_sb_232201 English
Profile version: 3.0.0    Status: 1 (0x7ce1a234)
Router IP: 192.168.0.254    Netmask: 255.255.255.0
Firmware Build Date/Time: Mar 18 2013 12:47:45
Router Name: Vigor2830n
Revision: 34461 drayos2011
ADSL Firmware Version: 232201_A  Annex A

-----OS Task Stack Information (Internal debug only) : min free space ---
 P#=116: size= 15356, free= 15108(98%) > XXXXXXXXXX :(void(*)(void))if_task_wan
 P#=118: size= 15356, free=  7080(46%) > XXXXX      :(void(*)(void))httpd_main
 P#=119: size= 15356, free= 12776(83%) > XXXXXXXXX  :ap_task
 P#=120: size= 15356, free= 15140(98%) > XXXXXXXXXX :(void(*)(void))if_task_bridge
 P#=121: size= 15356, free= 13088(85%) > XXXXXXXXX  :timer_task
 P#=122: size= 15356, free= 14212(92%) > XXXXXXXXXX :relay_task
 P#=123: size= 15356, free= 13644(88%) > XXXXXXXXX  :RemoteCapiTask
 P#=135: size= 15356, free= 11960(77%) > XXXXXXXX   :CM_Task
 P#=136: size= 15356, free= 12752(83%) > XXXXXXXXX  :PPTP_Task
 P#=137: size= 15356, free= 11088(72%) > XXXXXXXX   :IPv6_Task
 P#=138: size= 15356, free= 14188(92%) > XXXXXXXXXX :sstp_task
 P#=139: size= 15356, free= 11584(75%) > XXXXXXXX   :(void (*)(void))tnsfunc
 P#=140: size= 15356, free= 12516(81%) > XXXXXXXXX  :DSL_DRV_AutobootThreadMain
 P#=141: size= 15356, free= 13888(90%) > XXXXXXXXXX :dhcp_daemon
 P#=142: size= 15356, free= 13820(89%) > XXXXXXXXX  :ike_daemon
 P#=143: size= 15356, free= 13852(90%) > XXXXXXXXXX :ftpstart
 P#=144: size= 15356, free= 14000(91%) > XXXXXXXXXX :telnetd_main
 P#=145: size= 15356, free= 13616(88%) > XXXXXXXXX  :sshd_main
 P#=146: size= 15356, free= 15132(98%) > XXXXXXXXXX :gena_task
 P#=147: size= 15356, free= 15132(98%) > XXXXXXXXXX :soap_task
 P#=148: size= 15356, free= 12968(84%) > XXXXXXXXX  :RIP_Task
 P#=149: size= 15356, free= 11956(77%) > XXXXXXXX   :sntp_task
 P#=150: size= 15356, free= 13628(88%) > XXXXXXXXX  :LPD_Task
 P#=151: size= 15356, free= 13448(87%) > XXXXXXXXX  :usb_event_task
 P#=152: size= 15356, free= 15100(98%) > XXXXXXXXXX :usb_stor_control_thread
 P#=153: size= 15356, free= 15108(98%) > XXXXXXXXXX :Common_Mail_Task
 P#=154: size= 15356, free= 13116(85%) > XXXXXXXXX  :snmpmain
 P#=155: size= 15356, free= 15116(98%) > XXXXXXXXXX :lte_connection_thread
 P#=161: size= 15356, free= 12224(79%) > XXXXXXXX   :(void(*)(void))if_task_lan
 P#=162: size=  4096, free=  3852(94%) > XXXXXXXXXX :PMU_Task
 P#=163: size=  8192, free=  6488(79%) > XXXXXXXX   :IdleTask
Opened task no. = 31




Vigor adsl status describe debug

> adsl status descdbg
  --------------------------- ATU-R Info (hw: annex A, f/w: annex A) -----------
 Dsl rx desc error count=0, ch=0
 last err desc[0]=00000000, desc[1]=00000000[00000000]


Another hidden command ?

Saturday, 22 February 2014

Lenovo z710 - double suspend issue on Ubuntu 13.10

My z710 when suspended after a lid close, would un-suspend when the lid opened and then after 5 secs re-suspend itself.

Fix for this was to turn off the logind.conf settings and allow acpid to do all the work

vi /etc/systemd/logind.conf


#ignore all and use acpid instead
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
PowerKeyIgnoreInhibited=no
SuspendKeyIgnoreInhibited=no
HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no

Lenovo z710 and Ubuntu 13.10 wifi auto connect fix

My z710 wasn't auto connecting the wifi at bootup.

rfkill list showed odd modules that were blocked but not shown loaded with lsmod.

root@nick-Lenovo-Z710:~# rfkill list
0: ideapad_wlan: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
1: ideapad_bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
2: ideapad_3g: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: phy0: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
4: brcmwl-0: Wireless LAN
    Soft blocked: yes
    Hard blocked: no


Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> rfkill0: found WiFi radio killswitch (at /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C09:00/VPC2004:00/rfkill/rfkill0) (platform driver ideapad_acpi)
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> rfkill2: found WWAN radio killswitch (at /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C09:00/VPC2004:00/rfkill/rfkill2) (platform driver ideapad_acpi)
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> rfkill3: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/ieee80211/phy0/rfkill3) (driver wl)
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> rfkill4: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth1/rfkill4) (driver wl)
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> WiFi enabled by radio killswitch; disabled by state file
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> WWAN enabled by radio killswitch; enabled by state file
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> WiMAX enabled by radio killswitch; enabled by state file
Feb 22 20:24:25 nick-Lenovo-Z710 NetworkManager[942]: <info> WiFi now disabled by radio killswitch



The easiest fix was to unload and reload the 'wl' module

rmmod wl
modprobe wl

so i put this into /etc/rc.local, rebooted.

Wifi auto connect worked as soon as i logged in.


Friday, 17 January 2014

Displaying HEC FEC errors on a Draytek Vigor 2830n router

Displaying HEC FEC errors on a Draytek Vigor 2830n router


> adsl status more
  --------------------------- ATU-R Info (hw: annex A, f/w: annex A) -----------
                  Near End        Far End
 LatencyPath  :      2               2
 LoS          :      0               0
 LoF          :      0               0
 LPR          :      0               0
 RFI          :      0               0
 Ncd          :      0               0
 Lcd          :      0               0
 FECS         :    162               0
 ES           :      1               0
 LOSS         :      0               0
 UAS          :      0               0
 HECError     :      7               0
 CRC          :      1               0
 RsCorrection :   3671               0
 INP          :      0               0
 InterleaveDelay :    800             800
>   


Found this by uncompressing the firmware and running 'strings' over it.
Couldn't find it in the Draytek telnet command reference guide.

Sunday, 27 January 2013

Hornby Zero 1 testing

I always wanted a Zero 1 controller when i was a kid.   Sometimes you just have to treat yourself...





Here is my testbed setup.  Yes, i know it's running on the carpet which is really bad, but needs must.  :)



Three trains running on a single track at different speeds !   Yup, it was a good as i thought it would be 30 years ago.


Wednesday, 21 March 2012

Perl code to download your WatchList from eBay.


#!/usr/bin/perl

use strict;
use warnings;

use Net::eBay;
use Data::Dumper;

my $eBay = new Net::eBay;

# use new eBay API
$eBay->setDefaults( { API => 2, debug => 0 } );

my $result = $eBay->submitRequest( "GetMyeBayBuying",
    {
        DetailLevel => 'ReturnAll',
        WatchList => {
            Sort => 'TimeLeft',
            IncludeNotes => 'true',
            Pagination => {
                EntriesPerPage => 200,
                PageNumber => 1
            }
        }
    }
);
if( ref $result ) {
  print "Result: " . Dumper( $result ) . "\n";
};

Thursday, 10 November 2011

Diaspora

You can find me on diaspora now...

diasp.org (USA) and diasp.eu (EU).

You really should read the review here:  chronicle.com

 Remember you are the CUSTOMER NOT the PRODUCT !

Bye bye G+

I've left Google+, well they asked me to as i used a pseudonym...

c'est la vie, their loss...

Sunday, 30 October 2011

Pumpkin

Two things done today. 

1. Installed extra insulation in Loft and Kitchen - horrible, scratchy, dirty job.

2. Carved a pumpkin.

I have always fancied carving a pumpkin.  Thing is they are so small and bloody expensive here in the UK, plus i'm not a big fan of Halloween over here (it's a sad, sad attempt of what the Yanks can do - so why even bother).

Any way onto the pumpkin.





Okay so it looks quite small right...?




And here it is growing on the allotment in my pumpkin patch.



And the scary part...

Here we go CSI Warwickshire...  or daft insulation contractors...





Tuesday, 23 August 2011

Sort HTML table with a row header (2 row sort)

Table
ID NAME Value SPECIALIZATION
Row Header 11
1Angelina-1Computer Science
Row Header 22
2Martina10Mathematics
Row Header 33
3Tina0.5English
Row Header 44
4Simran100Biology
Row Header 55
5Christina-99Psychology
The code below allows the above table to sort the data values while keeping the row headers above. Something i couldn't find an example for on Google.
 function doSort(column, tableID, direction) {  
   var data = []  
   var table = document.getElementById(tableID);  
   var skip = 1; // skip column headers  
   // set up sortable data array [ sorted key, row data, header data ]  
   for (var i = skip + 1, l = table.rows.length; i < l; i=i+2) {  
           // grab each row - so we can clone later  
     var header_cell_row = table.rows[i - 1]; // header cell row data  
     var data_row = table.rows[i]; // sortable row data  
            var cell_data = table.rows[i].cells[column].innerHTML; // this is the bit we sort.  
             data.push([parseFloat(cell_data), data_row, header_cell_row])  
   };  
   //sort that array in the direction we ask  
   data.sort(  
     direction==0 ?  
       function(a,b){return a[0]<b[0]?-1:a[0]>b[0]?1:0} // ASC  
     :  
       function (a, b) { return a[0] > b[0] ? -1 : a[0] < b[0] ? 1 : 0} // DESC  
   )  
   // run thru sorted array  
   for (var i = 0, l = data.length; i < l; i++) {  
           // we append at the bottom of the original table the new sorted table  
           // as we have saved the real rows we can clone and append  
     //  
     // header row  
     //  
     var source = data[i][2];  
            table.appendChild(source.cloneNode(true));  
     //  
     // data row  
     //  
     var source = data[i][1];  
            table.appendChild(source.cloneNode(true));  
           //  
           // delete an old row from the table  
           //  
          table.deleteRow(1);  
           table.deleteRow(1);  
   }  
 }