Translate

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

Sunday, April 21, 2024

Ubuntu Core - run it on Virtualbox

Ubuntu Core is an OS designed for embedded machines, operates in different way than a standard Linux distribution.
This article explains how to install Ubuntu Core over a Virtual Machine (VM) using VirtualBox over a MacBook Pro Intel based, for development/experimentation purpose.

Ubuntu Core is not a standard distribution and cannot be installed directly over Virtualbox.
It is necessary to use a standard/normal Ubuntu distribution to be used as installer.

Sunday, March 26, 2023

Server chronical - Digitemp - reading from DS1490F

Digitemp is a software capable to read Dallas 1Wire sensors for the temperature, the DS18S20.

It was in use on the old server for years in order to acquire different temperatures and thus control automatically some Fans in the server room.

Let's see if it can be revived in the new server.

Sunday, November 20, 2022

Ubuntu - media, from iso to mp4/mkv


This is a brief note to describe how to solve a problem.


After reinstalling my media server I decided to do some spring cleaning.

I did find many movies I did record years ago and created as iso image.

In this way unfortunately is not easy to see them directly on Plex, the best way is to convert them in mp4 (or mkv).

Sunday, August 14, 2022

Server chronicles - Docker on ProLiant

At the base of the rebuilding of the services on the server, there is Docker.

Docker allows to run services in a dedicated environment.
Why ? Well, because different applications/programs can require different settings, like maybe the installation of specific languages or specific versions of them.
Instead to clutter the server with 3000 things, a docker image is totally self sufficient.

Sunday, August 7, 2022

Server chronicles - the OS on the old System76

The old System76 server has now new HDs and more RAM and is cleaned up.

Time to install the OS.

Saturday, October 17, 2020

Raspberry streaming audio - notes and VLC server

Time ago I did buy and built a Pimoroni kit to have a streaming IP radio.
Is time to try to enhance it little bit and add some extra information.

Friday, March 9, 2018

Update firmware of a GXV3000



The GXV3000 is an old phone from Grandstream, not anymore in production and supported, but still available on Ebay at a decent price.
It is possible to even find in Ebay "new" GXV3000, i.e. never used before, like one I bought recently as a replacement for a broken one.
So I had to go back on memory lane in order to update the firmware in it to the last available one (high recommended in order to fix the SPIT problem)
Here what is needed to do the job.


Friday, March 2, 2018

A personal CI system




In this article I'm describing how to set up and configure a basic CI (Continuos Integration) system that can be used for many  things, based on an open source program called Jenkins.

Of course, for my projects to set up a CI  to build them is just little bit overshooting, but surely is interesting and fun.




Sunday, April 13, 2014

Beagle-Board - Beaglebone Black - re-flash it

Yes, OK OK, another post on internet about how to re-flash a Beagle-board Beaglebone black (BBB).
Why ?

Well, I needed to bring back to the origins my BBB and I found tons of instructions if you have Windows or Mac and some contradictory or incomplete instructions for Linux.
So, here my brief note to describe how to re-flash a BBB.

This procedure should be used in order to install the image on the BBB internal memory.
Basically the image will be copied on the internal memory.

Download the image

The image to download MUST BE one for the flash.
Normally is called BBB-eMMC-flasher-yyyy.mm.dd.img.xz from the Beagleboard latest images  link.
oh wait .. WHAT image ?

Well, I wanted to restore the original configuration as when I received the board, so Angstrom.

Prepare the image

On the net there are many places that describe how to do that under Window or Mac OS.
I'm using Ubuntu 10.04 LTS. Any versions however should do.
It is needed :


  • Archive Manager
  • Disk Utilities
  • dd


With the Archive Manager extract the image from the compressed file.

Load the image on the card 

You will end up with a file approx 3.6 Gbyte, so better to use at least a 4 Gbyte micro SD card or better, 8 Gbyte one like I did.
Put the micro SD card in a reader and connect it to the USB port.
Using Disk Utilities identify the added driver, it will be something in the range /dev/sdx.
Also, using the Disk Utility, unmount any partition eventually present on the microSD card.

Open a terminal, go in the directory where is contained the image file and in sudo mode type this command :

sudo dd if=BBB-eMMC-flasher-yyyy.mm.dd.img of=/dev/sdx bs=1M

where yyyy.mm.dd is the part of the image name with the date and x is the correct driver associated with the inserted SD card.
BE VERY CAREFUL in this phase.
A misspelled driver name can format something else !

After few minutes the SD card will be ready.

Flashing the board


Time to flash the board.
ATTENTION !  The procedure can take quite a while !
Allow at least 30 to 45 minutes ! It could take longer though.

Follow these steps :


  • Be sure to have the board powered down
  • Remove any cape and USB stuff
  • Insert the microSD card in the microSD card slot
  • Push down the S2 button
  • Power up the board KEEPING PUSHED S2
  • When the 4 LEDs goes on, release S2
  • Some activity on the LEDs will indicate the loading process
  • Wait until ALL the 4 LEDs  are back ON - steady ON
  • Power off the board
  • Remove the microSD card
  • Reconnect cape and USB stuff if you have it
  • power up again the board

I found in my case, that it is important to have the "bare" board, no capes or USB stuff attached.
I had a USB dongle for an external wireless keyboard and I was unable to flash the NAND.
After removing LCD cape and USB dongle, I was able to flash the NAND without any problem.

Now I have the board running happily with full X server on the LCD.

Hope this article can help somebody

Tuesday, June 5, 2012

Messages between computers (Linux)

In the era of internet, sometime small needs are solved using complicate applications, when "old" but more functional solutions are available.
If, like me, somebody has the need to exchange quick messages between users inside a LAN, here an easy and functional solution.

Problem

To better define the problem, the need is to be able to send to a user on a computer in the LAN, a brief message.
It is assumed the computer running Linux (Ubuntu).
The user doesn't have to start any application nor do something.
Ideally a "popup" window with the message appears on the screen.

Solution

Two programs are needed and "usually" they are installed by default in a standard Ubuntu and Kubuntu distribution.
It is possible to use other programs, but these two are quite easy to use and the "popup" effect is nice.
In order to receive messages, EACH computer we want be able to do so, need to have a "daemon" running.

Here some pro and cons

Pro

  • easy to implement
  • no special programs to install
  • transparent to the user
Cons
  • it is necessary to know the IP address of the computer where to send the message
    If the computer has a fixed IP is not a big deal. In a DHCP environment it could be a problem
  • it address the machine, not the user so it is implicit only ONE user is using the machine
  • ending the process that sends messages, ends also the receiver
  • in order to send more than one message, the receiver needs to acknowledge the messages hitting OK

Prerequisites

I'm assuming :
  • you are capable to open a terminal
  • you are capable to open an editor 
  • you are capable to change file properties
  • you are capable to install programs
  • you don't run in the church if you hear the word "daemon"
  • you have admin permission
If you don't understand one of more of the above prerequisites, then better to ask somebody that understand that to set up the system.

Creating the daemon


The daemon is a program that is running in background. In this case the daemon is a bash script.
Here a step by step guide to create the daemon. Remember, this must be done on each computer we want to be able to receive messages.
Of course is possible to prepare the script somewhere else and copy it on the computer.
Again, it is assumed we are using Ubuntu or Kubuntu with zenity and netcat installed.
  1. open a terminal
    You should end up in your  default home directory
  2. open an editor, for example
    $ vim bkmsg.sh
  3. insert in the file these lines :
    #!/bin/bash
    msgport=3564
    nc -l $msgport | while read message; do zenity --info --text "$message"; done
  4. save the file
  5. make the file executable
    $ chmod +x bkmsg.sh
At this point we have the daemon script ready.
To test it, simply run it in background from the terminal : $ ./bkmsg.sh &
Then open another terminal and digit : nc localhost 3564
When you hit Enter, everything you type until the next Enter, will be sent as message and a popup window will appear.
To stop to send messages, simply hit Ctrl-C.

It is important to understand that even if the script is running in background, closing the terminal where the daemon was started, will end the daemon.

Installing the daemon


We need to have the daemon installed and run automatically.
To do so, we need to put our script in the startup list of application.
Be aware that ending the process that sends messages, ends also the daemon !

Sending messages


In order to send a message to the machine, it is necessary to know :

  1. the IP address of the machine where to send the message
  2. the port used to send message (the one in the script, in the example above it would be 3564
The is enough to open a terminal and digit :

$ nc ip_address_where_to_send_the_msg port

For example if the machine has the IP address 192.168.1.134 and the port the one of the example :

$ nc 192.168.1.134 3564

After that every thing written will be sent to the remote machine after hitting the key Enter.
To close the process, hit Ctrl-D or Ctrl-C.
Be careful that doing so, will close also the daemon on the remote machine !

Wednesday, September 7, 2011

Ubuntu boot problems

One of the Ubuntu machines I have, today woke up in the bad mood.
The boot failed ending in a BusyBox splashscreen :

Busybox v1.1.3 (debian 1:1.1.3-5ubuntu12) Built in shell (ash) Enter 'help' for a list of built-commands

The problem is relatively simple, the hard drive screw up a little bit.
Many suggestions found on the net suggested to boot in Windows, do a check of the disk and re-boot.
That's nice if you have Windows installed somewhere.

For who, like me, doesn't have Windows nor even think about to install it, here a simple workaround.


  1. Look for a live Linux distro and boot the PC with it
    I used Knoppix.
  2. Look for GParted (Disk partition utility)
  3. In GParted look the drive (hard drive), select it, choose "check"
  4. When the check is finished, reboot normally
It should work.
It worked for me anyway :-)

Wednesday, August 17, 2011

Use Wireshark to monitor a VoIP phone


In a typical LAN environment, today are in use routers and switches.
This improves a lot the performances of a network but make more complicate to monitor a specific appliance, like a VoIP phone. 
In order to capture the traffic on a specific node, assuming is not possible to run a monitor tool on the node itself, it is necessary to use a tool capable to be put between the nodes, or use a switch/router with monitor capabilities.
The main monitor tool in this discussion is the program Wireshark.
There is an article about this issue  on the Wiki for Wireshark .
Since I don't have a switch with monitor capabilities,  the fastest way to set up a generic monitor machine is to use a laptop, with two NIC cards, acting as bridge and running Wireshark on one of the two NIC or on the bridge itself.


Shopping list
It is needed :

  • 1 laptop with Linux installed, with two ethernet ports
  • 1 PCMCA  NIC if the laptop  has already an embedded NIC
  • bridge utilities
  • Wireshark

The environment

The machine used to build the monitor is a Gateway Tablet running Ubuntu 11.04, plus a LinkSys PCMCA NIC  card.
The first step, recognizing the extra NIC card, should not pose any problem.
In my case the LinkSys NIC was recognized and configured automatically by the OS as eth1.
The next step is to install  Wireshark from the Ubuntu repository, and enabled it to capture packets from eth0 or eth1.
Here the configuration  adopted for the machine :
  wshark_1.png
Bridge setting
After preparing the hardware and tested both the ethx ports, it is necessary to set up the machine to act as a bridge, in order to have packets received from the eth0 port sent to the eth1 port, and viceversa.
Without such functionality, the two networks are isolated, i.e. the phone can not receive anything from the network.
In order to simplify the configuration, I forced on both the NIC a manual address.

  • 192.168.2.70
    for the eth0
  • 192.168.2.71
    for the eth1.

After opening a terminal,  install the  brctl  program (sudo apt-get install bridge-utils).
The bridge-utils are not installed by default in the Ubuntu 11.04 but are available in the repository.
At this point I created, configured and activated  a bridge between the two NICs.
  • sudo brctl addbr wshark
    Create a new bridge called wshark
  • sudo brctl addif wshark eth0 Add the eth0 to the wshark bridge
  • sudo brctl addif wshark eth1
    Add the eth1 to the wshark bridge
  • sudo brctl stp wshark on Enable the STP
After creating the bridge, it has to be activated.
To do so, simply use the ifconfig command :
sudo ifconfig wshark up
At this point the bridge should be  working. 

Running Wireshark

After the bridge is activated is possible to run Wireshark.
Among  the available interfaces to use to capture traffic, it will be present a wshark interface that is the bridge.
To capture data is possible to use it.
That's it.