Language Selection

English French German Italian Portuguese Spanish

Howtos

Using Menus For Command Line Programs and Scripts

Filed under
Howtos

THE holidays are coming (Christmas approaching), so I've taken advantage of some spare time to menu-ise commands that I use frequently. Those commands aren't the mere opening of an application and they often require dealing with input and output (in the command line). So I've created menu.sh and used dialog to craft the following menu, e.g. for operations associated with Techrights. I invoke this menu with the click of one button (of the mouse).

Rianne has a similar menu for commands she often runs (which are long and would otherwise need pasting or typing in length). Her menu looks something like this:

Rianne's menu

Here's the code (bash file) that renders the menu above (it's really that simple!):


#!/bin/bash

HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="Aloha, Rianne"
TITLE="Rianne @ Ted"
MENU="Choose one of the following options:"

OPTIONS=(1 "Start VPN"
         2 "REDACTED"
         3 "REDACTED"
	4 "REDACTED"
	5 "REDACTED"
	6 "REDACTED"
	7 "REDACTED"
)

CHOICE=$(dialog --clear \
                --backtitle "$BACKTITLE" \
                --title "$TITLE" \
                --menu "$MENU" \
                $HEIGHT $WIDTH $CHOICE_HEIGHT \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)

clear
case $CHOICE in
        1)
            echo "You chose Option 1"
sh ~/vpn.sh ;;

        2)
            echo "You chose Option 2"
REDACTED COMMAND ;;
        3)
            echo "You chose Option 3"
REDACTED COMMAND ;;
        4)
            echo "You chose Option 4"
REDACTED COMMAND ;;
        5)
            echo "You chose Option 5"
REDACTED COMMAND ;;
        6)
            echo "You chose Option 6"
REDACTED COMMAND ;;
        7)
            echo "You chose Option 7"
REDACTED COMMAND ;;

esac

Hopefully this inspires other people out there to do the same. It takes a while to set up, but it's a big time saver over the long run.

The Bash Fingertips: Making Your Own 'Information Centre'

Filed under
Howtos

Information Centre

FORGET bloated Web browsers. Forget so-called 'social' media (I call it social control media). They're not efficient, they eat up a lot of memory and CPU cycles, and the interfaces are not consistent (across sites). They're sufficiently distracting and they have ads. They erode privacy. They don't scale well; neither for an aging system (my laptop turns 10 in a few months) nor for users. GUIs are good in particular scenarios, but when the same things are repeated over and over again one might as well set up scripts, automating things and tailoring one's own interfaces, which is easy to achieve (relatively fast and simple) in the command line. It's also more accessible, e.g. over SSH. The pertinent tools are already out there (available for download/installation from repositories), they just need to be put together and programming skills aren't required, just batching in a bash file.

Some years ago I 'developed' a little script (I've been scripting since I was about 12). I called it getswap-sorted.sh and it just ran another script that helped me see what applications use the swap (and how much of it). For the sake of speed I like to restart applications that heavily use swap (i.e. depend on magnetic disk operations). I don't have much RAM. I never had more than 2 GB. getswap-sorted.sh just called out ./getswap.sh | sort -n -k 5 and getswap.sh comes from Erik Ljungstrom. Here it is:

#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
done
echo "PID=$PID - Swap used: $SUM - ($PROGNAME )"
let OVERALL=$OVERALL+$SUM
SUM=0

done

The output of getswap-sorted.sh would be something like this:


PID=1559 - Swap used: 16472 - (x-terminal-emul )
PID=21980 - Swap used: 16648 - (kwalletd5 )
PID=25548 - Swap used: 16704 - (konversation )
PID=631 - Swap used: 19336 - (kded5 )
PID=23817 - Swap used: 50048 - (pidgin )
PID=23923 - Swap used: 180312 - (thunderbird )


This helps me see which application/process number uses swap and to what degree. It's sorted by the amount of swap taken and the PID helps when I just want to kill a process from the command line (some are small and obsolete anyway).

My script, however, grew bigger over time. I added more things to it, eventually binding it to a special (fifth) mouse key, using xbindkeys -- an immensely valuable and powerful program I've used since around 2004. Extra mouse buttons always seemed worthless (anything more than three), but that's just because there was no program I needed to open or action I needed to invoke often enough. Over time I found that keeping a new terminal one click away (fourth button) and another special terminal also a click away improved my workflow/productivity. I just needed to invest some time in tailoring it. I ended up opening, temporarily, a terminal window with important information displayed, such as weather, disk space (I'm always near the limits), swap usage (I have only 2GB of RAM), uptime, real-time football scores etc. Change of wallpapers was lumped in too, for good measure...

For football tables/scores use one of the following 1) livescore-cli 2) soccer-cli and 3) football-cli.

Sadly, the above CLI football scores' tools got 'stolen' by Microsoft and need to isolate themselves GitHub, in due cource/time. I use the first of the three as it suits my needs best and does not require an API key.

The output looks like this:

 ... Fetching information from www.livescore.com ... 
Displaying Table for Barclay's Premier League
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                Barclay's Premier League TABLE
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 LP     Team Name               GP      W       D       L       GF      GA      GD      Pts
--------------------------------------------------------------------------------------------------
 1      Liverpool               24      19      4       1       55      14      41      61
 2      Tottenham Hotspur       25      19      0       6       51      24      27      57
 3      Manchester City         24      18      2       4       63      19      44      56
 4      Chelsea                 25      15      5       5       45      23      22      50
 5      Arsenal                 24      14      5       5       50      33      17      47
 6      Manchester United       24      13      6       5       48      35      13      45
 7      Wolverhampton Wanderers 25      11      5       9       33      32      1       38
 8      Watford                 25      9       7       9       33      34      -1      34
 9      Everton                 25      9       6       10      36      36      0       33
 10     AFC Bournemouth         25      10      3       12      37      44      -7      33
 11     Leicester City          24      9       5       10      30      30      0       32
 12     West Ham United         24      9       4       11      30      37      -7      31
 13     Brighton & Hove Albion  25      7       6       12      27      36      -9      27
 14     Crystal Palace          25      7       5       13      26      33      -7      26
 15     Newcastle United        25      6       6       13      21      33      -12     24
 16     Southampton             25      5       9       11      27      42      -15     24
 17     Burnley                 25      6       6       13      26      46      -20     24
 18     Cardiff City            25      6       4       15      22      46      -24     22
 19     Fulham                  25      4       5       16      25      55      -30     17
 20     Huddersfield Town       25      2       5       18      13      46      -33     11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 LP = League Position   GP = Games Played       W = Wins        D = Draws       L = Lose 
 GF = Goals For         GA = Goal Against       GD = Goal Differences
--------------------------------------------------------------------------------------------------
 Champions League       Champions League qualification  Europa League
 Europa League qualification    Relegation
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Real-time scores (when matches are on):

 ... Fetching information from www.livescore.com ... 
Displaying Scores for Barclay's Premier League
----------------------------------------------------------------------------
                 Barclay's Premier League SCORES 
----------------------------------------------------------------------------
 January 29  FT     Arsenal                  2 - 1  Cardiff City           
 January 29  FT     Fulham                   4 - 2  Brighton & Hove Albion 
 January 29  FT     Huddersfield Town        0 - 1  Everton                
 January 29  FT     Wolverhampton Wanderers  3 - 0  West Ham United        
 January 29  FT     Manchester United        2 - 2  Burnley                
 January 29  FT     Newcastle United         2 - 1  Manchester City        
 January 30  FT     AFC Bournemouth          4 - 0  Chelsea                
 January 30  FT     Southampton              1 - 1  Crystal Palace         
 January 30  FT     Liverpool                1 - 1  Leicester City         
 January 30  FT     Tottenham Hotspur        2 - 1  Watford                
 February 2  FT     Tottenham Hotspur        1 - 0  Newcastle United       
 February 2  FT     Brighton & Hove Albion   0 - 0  Watford                
 February 2  FT     Burnley                  1 - 1  Southampton            
 February 2  FT     Chelsea                  5 - 0  Huddersfield Town      
 February 2  FT     Crystal Palace           2 - 0  Fulham                 
 February 2  FT     Everton                  1 - 3  Wolverhampton Wanderers
 February 2  FT     Cardiff City             2 - 0  AFC Bournemouth        
 February 3  15:05  Leicester City           ? - ?  Manchester United      
 February 3  17:30  Manchester City          ? - ?  Arsenal                
 February 4  21:00  West Ham United          ? - ?  Liverpool              
----------------------------------------------------------------------------
---------------------------------------

Now putting it all together:


feh --bg-fill --randomize /media/roy/c3fd5b6e-794f-4f24-b3e7-b4ead3722f11/home/roy/Main/Graphics/Wallpapers/Single\ Head/natgeo/* &

livescore -t bpl 

./getswap.sh | sort -n -k 5
 curl -4 http://wttr.in/Manchester
 swapon --summary | grep sda2
 df | grep sda1
uptime

sleep 10

livescore -s bpl 

sleep 40

The first line is feh choosing a wallpaper at random from a collection of award-winning National Geographic photographs. The options and the underlying parameters are self-explanatory.

The football league's table is then shown.

Next, after about 10 seconds of processing, a list of processes will show up based on swap usage (as described above)

The weather at home (Manchester) will then be shown, with colour. Right now I get:

Weather report: Manchester

     \   /     Sunny
      .-.      -5--2 °C       
   ― (   ) ―   ↑ 9 km/h       
      `-’      10 km          
     /   \     0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  Sun 03 Feb ├───────────────────────┬──────────────────────────────┐
│            Morning           │             Noon      └──────┬──────┘     Evening           │             Night            │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│    \  /       Partly cloudy  │      .-.      Light drizzle  │  _`/"".-.     Light rain sho…│               Mist           │
│  _ /"".-.     -4-0 °C        │     (   ).    -2-3 °C        │   ,\_(   ).   1-3 °C         │  _ - _ - _ -  0-3 °C         │
│    \_(   ).   ↑ 12-20 km/h   │    (___(__)   ↑ 17-26 km/h   │    /(___(__)  ↗ 7-14 km/h    │   _ - _ - _   ↑ 9-17 km/h    │
│    /(___(__)  20 km          │     ‘ ‘ ‘ ‘   20 km          │      ‘ ‘ ‘ ‘  16 km          │  _ - _ - _ -  13 km          │
│               0.0 mm | 0%    │    ‘ ‘ ‘ ‘    0.4 mm | 83%   │     ‘ ‘ ‘ ‘   0.4 mm | 65%   │               0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  Mon 04 Feb ├───────────────────────┬──────────────────────────────┐
│            Morning           │             Noon      └──────┬──────┘     Evening           │             Night            │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│      .-.      Light drizzle  │  _`/"".-.     Patchy rain po…│               Cloudy         │               Cloudy         │
│     (   ).    2-6 °C         │   ,\_(   ).   3-7 °C         │      .--.     1-4 °C         │      .--.     -2 °C          │
│    (___(__)   → 16-26 km/h   │    /(___(__)  → 20-27 km/h   │   .-(    ).   → 13-23 km/h   │   .-(    ).   ↗ 9-16 km/h    │
│     ‘ ‘ ‘ ‘   14 km          │      ‘ ‘ ‘ ‘  18 km          │  (___.__)__)  20 km          │  (___.__)__)  20 km          │
│    ‘ ‘ ‘ ‘    0.3 mm | 88%   │     ‘ ‘ ‘ ‘   0.3 mm | 88%   │               0.0 mm | 0%    │               0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  Tue 05 Feb ├───────────────────────┬──────────────────────────────┐
│            Morning           │             Noon      └──────┬──────┘     Evening           │             Night            │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│    \  /       Partly cloudy  │               Overcast       │               Overcast       │      .-.      Light drizzle  │
│  _ /"".-.     -1-3 °C        │      .--.     2-6 °C         │      .--.     6 °C           │     (   ).    1 °C           │
│    \_(   ).   ↖ 19-31 km/h   │   .-(    ).   ↑ 23-33 km/h   │   .-(    ).   ↑ 24-40 km/h   │    (___(__)   ↑ 24-40 km/h   │
│    /(___(__)  20 km          │  (___.__)__)  19 km          │  (___.__)__)  8 km           │     ‘ ‘ ‘ ‘   9 km           │
│               0.0 mm | 0%    │               0.0 mm | 0%    │               0.0 mm | 0%    │    ‘ ‘ ‘ ‘    0.3 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘


After this I am shown general memory usage and disk usage (for a particular partition) along with uptime thusly:

/dev/sda2                               partition       2097148 381128  -1
/dev/sda1        84035088   77299588   2443660  97% /
 08:03:28 up 116 days, 12:36,  7 users,  load average: 1.70, 1.40, 1.26

It will close on its own after I see what needs seeing, owing to the sleep command. It saves me the clicking (required to then close the window); it just fades away or 'expires', so to speak (until the next time the mouse button gets pressed).

How to rename files in bulk

Filed under
Howtos

Consider this common scenario. A directory contains multiple files that are named using a common convention: for example, image-001.png, image-002.png, image-003.png, etc. You want to rename the files to, say, upload-001.png, upload-002.png, upload-003.png, etc.

The coders among us can write a bash script to automate the process. For expedience, this post shows how to use the built-in rename command to achieve the same goal.

Fixing OpenSuse’s Dog Awful default fonts…

Filed under
Howtos

Lets not beat around the bush here, the default font rendering in OpenSuse and the default font do not an OS fit for reading make.. this can be fixed however..

Love or hate Ubuntu, out of the box it has one of the best font rendering setups of any distro and considering how much time we spend on our PC’s setting your fonts up correctly is one less headach, literally.

I’m not sure how much of these instructions I got right, however after a reboot the screen text does at least look better..

Read More

Stopping Screen Flickering on Ivy Bridge Laptops using Linux

Filed under
Howtos

This is a solution to a problem which has been dogging me on every version of Linux I install on the Acer Aspire S3. I'm hoping it will help someone.

Read my solution

Forgot your Ubuntu Password? All is not lost.

Filed under
Howtos

It’s always a pain when you forget your password, and i’ve often done it on an Ubuntu install. All however is not lost as a stock Ubuntu install its quite easy to reset your password

Read More

Creating an AD Server for Free using Ubuntu and Samba

Filed under
Howtos

While being a huge fan of the GNU/Linux OS I do also live in the real world which means using Active Directory Domain Controllers and Windows networks. this week however I’ve had to build for a project a stand alone AD network. This got me thinking to a project I built for a school 6 uears ago which I did the same thing with Samba on Fedora.

Remote Application launching using X11 and SSH.. Oldie but a goodie..

Filed under
Howtos

Using WordPress as my central blog platform I’m very happy with it, not much to complain about, some good features, it’s very social and some nice themes. However it’s got me thinking not so much my content i’m now having a “problem” to manage it’s dealing with the replies

Read More

Using the right tools to get your media..

Filed under
Howtos

When it comes to getting what you want off the interent, its pretty fair to say, that there is an application and a set of instructions to do this. In this day and age its fair to say that getting media off the web should be the way that media companies distribute. Instead of trying to reinvent the wheel. Unfortunately they don't they bog you down with Websites, DRM, Magma and lots more.. Well This is how to get your media another way..

Standard Disclaimer: Your use of this software and configuration is at your own risk. Check the legality of downloading TV shows in your area. This post is purely for the sake of information.

.

Read more...

Big Bear's Helpful Hints-Google Docs Spreadsheets

Filed under
Howtos

I like to jot down things that I learn how to do on the spur of the moment so that I can find it later.

I admit, in the 80's there was quite of bit of "herbal remedy" usage and my short term memory isn't what it could be. That's my story and I'm sticking to it.

I've decided that I might as well potentially help some other folks who might want to know about some of the things I discover, so I thought why not here?

For my very first post, I wanted to figure out how to sum cells across multiple pages in Google Docs spreadsheets.

Syndicate content

More in Tux Machines

Oracle, Red Hat, and CloudLinux

  • Cloud Native Patterns: a free ebook for developers

    Building cloud native applications is a challenging undertaking, especially considering the rapid evolution of cloud native computing. But it’s also very liberating and rewarding. You can develop new patterns and practices where the limitations of hardware dependent models, geography, and size no longer exist. This approach to technology can make cloud application developers more agile and efficient, even as it reduces deployment costs and increases independence from cloud service providers. Oracle is one of the few cloud vendors to also have a long history of providing enterprise software. Wearing both software developer and cloud service provider hats, we understand the complexity of transforming on-premises applications into cloud native applications. Removing that complexity for customers is a guiding tenet at Oracle.

  • Red Hat extends certification expiration dates and expands remote offerings

    In 2020, remote exams became the standard experience for certificate-hopefuls across many fields. Red Hat worked quickly to release four of our most in-demand exams in this format. We have seen remote exams grow rapidly in popularity with our candidates. As we roll into 2021, our list has expanded with even more offerings. Now, you can take advantage of more remote exams to validate your skills in Red Hat’s most in-demand technologies, including OpenShift, Ansible, Containers and Kubernetes, and more.

  • CloudLinux Expands Its Extended Lifecycle Support Services to Cover More End-of-Life Linux Distributions
  • CloudLinux to Offer Lifecycle Support Services for Expired Linux Distributions

    CloudLinux on Monday announced the expansion of its affordable Extended Lifecycle Support (ELS) services for Linux distributions, by providing its own updates and security patches for several years after expiration of the products’ end-of-life date.

Sharing and Free Software Leftovers

  • 10 fabulous free apps for working with audio, video, and images

    You want Photoshop-like features without the Photoshop-like price tag, and, for that, there’s Gimp. Free, open-source, and available for Windows, Mac, and Linux, this powerful tool can be used by graphic designers, photographers, and illustrators alike.

  • Gnuastro 0.14 released
    Dear all,
    
    I am happy to announce the availability of Gnuastro 0.14. For the full
    list of added and changed/improved features, see the excerpt of the
    NEWS file for this release in [1] below.
    
    Gnuastro is an official GNU package, consisting of various
    command-line programs and library functions for the manipulation and
    analysis of (astronomical) data. All the programs share the same basic
    command-line user interface (modeled on GNU Coreutils). For the full
    list of Gnuastro's library, programs, and a comprehensive general
    tutorial (recommended place to start using Gnuastro), please see the
    links below respectively:
    
    https://www.gnu.org/s/gnuastro/manual/html_node/Gnuastro-library.html
    https://www.gnu.org/s/gnuastro/manual/html_node/Gnuastro-programs-list.html
    https://www.gnu.org/s/gnuastro/manual/html_node/General-program-usage-tutorial.html
    
    The most prominent new feature may be the new Query program (called
    with 'astquery'). It allows you to directly query many large
    astronomical data centers (currently VizieR, NED, ESA and ASTRON) and
    only download your selected columns/rows. For example with the command
    below you can download the RA, Dec and Parallax of all stars in the
    Gaia eDR3 dataset (from VizieR) that overlap with your
    'image.fits'. You just have to change '--dataset' to access any of the
    +20,000 datasets within VizieR for example! You can also search in the
    dataset metadata from the command-line, and much more.
    
      astquery vizier --dataset=gaiaedr3 --overlapwith=image.fits \
               --column=RAJ2000,DEJ2000,Plx
    
    See the new "Query" section in the Gnuastro book for more:
    
    https://www.gnu.org/software/gnuastro/manual/html_node/Query.html
    
    Here is the compressed source and the GPG detached signature for this
    release. To uncompress Lzip tarballs, see [2]. To check the validity
    of the tarballs using the GPG detached signature (*.sig) see [3]:
    
      https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.14.tar.lz    (3.6MB)
      https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.14.tar.gz    (5.6MB)
      https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.14.tar.gz.sig (833B)
      https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.14.tar.lz.sig (833B)
    
    Here are the MD5 and SHA1 checksums:
    
    30d77e2ad1c03d4946d06e4062252969  gnuastro-0.14.tar.gz
    f3ddbc4b5763ec2742f9080d42b69ed3  gnuastro-0.14.tar.lz
    cfbcd4b9ae1c5c648c5dc266d638659f0117c816  gnuastro-0.14.tar.gz
    4e4c6b678095d2838f77b2faae584ea51df2d33c  gnuastro-0.14.tar.lz
    
    I am very grateful to (in alphabetic order) Pedram Ashofteh Ardakani,
    Thérèse Godefroy, Raúl Infante-Sainz, Sachin Kumar Singh, Samane Raji
    and Zahra Sharbaf for directly contributing to the source of Gnuastro
    since the last alpha-release. It is great that in this release we have
    an equal gender balance in the contributors. I sincerely hope this can
    continue in the next release :-).
    
    I am also very grateful to (in alphabetic order) Antonio Diaz Diaz,
    Paul Eggert, Andrés García-Serra Romero, Thérèse Godefroy, Bruno
    Haible, Martin Kuemmel, Javier Licandro, Alireza Molaeinezhad, Javier
    Moldon, Sebastian Luna Valero, Samane Raji, Alberto Madrigal, Carlos
    Morales Socorro, Francois Ochsenbein, Joanna Sakowska, Zahra Sharbaf,
    Sachin Kumar Singh, Ignacio Trujillo and Xiuqin Wu for their very
    useful comments, suggestions and bug fixes that have now been
    implemented in Gnuastro since the last alpha-release.
    
    If any of Gnuastro's programs or libraries are useful in your work,
    please cite _and_ acknowledge them. For citation and acknowledgment
    guidelines, run the relevant programs with a `--cite' option (it can
    be different for different programs, so run it for all the programs
    you use). Citations _and_ acknowledgments are vital for the continued
    work on Gnuastro, so please don't forget to support us by doing so.
    
    This tarball was bootstrapped (created) with the tools below. Note
    that you don't need these to build Gnuastro from the tarball, these
    are the tools that were used to make the tarball itself. They are only
    mentioned here to be able to reproduce/recreate this tarball later.
      Texinfo 6.7
      Autoconf 2.70
      Automake 1.16.2
      Help2man 1.47.17
      ImageMagick 7.0.10-59
      Gnulib v0.1-4396-g3b732e789
      Autoconf archives v2019.01.06-98-gefa6f20
    
    The dependencies to build Gnuastro from this tarball on your system
    are described here:
      https://www.gnu.org/s/gnuastro/manual/html_node/Dependencies.html
    
    Best wishes,
    Mohammad
    
  • LibreOffice Community Member Monday: Felipe Viggiano and Zhenghua Fong

    In the future, I would like to start contributing more with others teams, and with TDF in order to help increase LibreOffice’s success. In my opinion, LibreOffice needs to be better known – we have a great free office solution that attends the majority of the requirements of the general public, but, at least in Brazil, many people are not aware of this!

  • ISA2 Launches New Open Source Bug Bounties

    Awards of up to EUR 5000 are available for finding security vulnerabilities in Element, Moodle and Zimbra, open source solutions used by public services across the European Union. There is a 20% bonus for providing a code fix for the bugs they discover.

  • Amazon Creates ALv2-Licensed Fork of Elasticsearch

    Amazon states that their forks of Elasticsearch and Kibana will be based on the latest ALv2-licensed codebases, version 7.10. “We will publish new GitHub repositories in the next few weeks. In time, both will be included in the existing Open Distro distributions, replacing the ALv2 builds provided by Elastic. We’re in this for the long haul, and will work in a way that fosters healthy and sustainable open source practices—including implementing shared project governance with a community of contributors,” the announcement says.

  • Elasticsearch and Kibana are now business risks

    In a play to convert users of their open source projects into paying customers, today Elastic announced that they are changing the license of both Elasticsearch and Kibana from the open source Apache v2 license to Server Side Public License (SSPL). If your organisation uses the open source versions of either Elasticsearch or Kibana in its products or projects, it is now at risk of being forced to release its intellectual property under terms dictated by another.

  • Wikipedia Turns Twenty

    If there is a modern equivalent to Encyclopédie for cultural impact, scale of content, and controversy, it’s surely Wikipedia, the free open-source online encyclopedia run by the not-for-profit Wikimedia Foundation. Started by entrepreneurs Jimmy Wales and Larry Sanger on January 15th, 2001, it has since grown to become one of the world’s top 15 websites with a vast database of 55 million articles in 317 languages, as well as a family of related projects covering everything from travel guides to recipes. Beloved of geeks, friend to lazy students and journalists alike, and bane to procrastinators, it celebrates its 20th birthday this month.

    It’s hard to overstate just how much information is on Wikipedia. You can instantly find the average July temperature in Lisbon, the difference between an ale and a lager, the historical background to the Fifth Amendment of the United States Constitution, or the full list of 10 ways a batsman can be out in cricket. The illustrated article on aguaxima includes far more information than Diderot’s effort, and readers can find a far more accurate article on religion in Sweden. These articles all link to their sources, so a reader can do their own fact-checking.

    There is one more crucial difference between Encyclopédie and Wikipedia, though. Encyclopédie’s subscribers needed to pay 280 livres for it, far beyond the wages of an ordinary person. But anyone who can afford a device with an Internet connection can access Wikipedia wherever they go. This accessibility was game-changing.

Programming Leftovers

  • An Introduction to Bash Brace Expansion

    The Borne Again Shell (BASH) has a lot of great features that it borrows from other shells and even from some programming languages. It was created in the late 1980s in a response to a lacking in the current available shells on Berkley Distributions (BSD), and the predecessor to Linux, GNU. BASH features numerous in-built features such as in-line scripting capabilities like brace expansion, which we are going to examine today.

  • Rakudo Weekly News: 2021.04 Grant Reporting
  • The Trouble with Reference Counting

    Perl uses a simple form of garbage collection (GC) called reference counting. Every variable created by a Perl program has a refcnt associated with it. If the program creates a reference to the variable, Perl increments its refcnt. Whenever Perl exits a block it reclaims any variables that belong to the block scope. If any are references, their referenced values’ refcnt are either decremented or they’re reclaimed as well if no other references to them remain.

  • Dustin J. Mitchell: The Horrors of Partial-Identity Encodings -- or -- URL Encoding Is Hard

    URL encoding is a pretty simple thing, and has been around forever. Yet, it is associated with a significant fraction of bugs in web frameworks, libraries, and applications. Why is that? Is there a larger lesson here?

  • Enrico Zini: nspawn-runner: support for image selection

    .gitlab-ci.yml supports 'image' to allow selecting in which environment the script gets run. The documentation says "Used to specify a Docker image to use for the job", but it's clearly a bug in the documentation, because we can do it with nspawn-runner, too. It turns out that most of the environment variables available to CI runs are also available to custom runner scripts. In this case, the value passed as image can be found as $CUSTOM_ENV_CI_JOB_IMAGE in the custom runner scripts environment.

  • Introduction to Making GraphQL APIs and Apps in Node.js – Linux Hint

    The communication and data transfer between the front end and backend of any application occurs through APIs (Application Programming Interface). There are many different types of APIs used to communicate between the front and back-end applications like RESTful API, SOAP API, GraphQL API, etc. The GraphQL API is a relatively new technology, and it is much faster than other types of APIs available. Fetching data from the database using GraphQL api is much faster than the REST API. While using GraphQL API, the client has control to fetch only the required data instead of getting all the details; that is why GraphQL API works faster than REST API.

  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

    Today, I had installed PHP 7.3 and phpMyAdmin on Ubuntu 18.04 LTS system. I am using MariaDB as database server running on the same instance. When I tried to access data in tables using phpMyAdmin got the following error message on screen.

  • C++ Access Specifiers – Linux Hint

    In C++, a class is a set of variables and functions that have been configured to work together. When the variables of the class are given values, an object is obtained. An object has the same variables and functions as a class, but this time, the variables have values. Many objects can be created from one class. One object differs from another object according to the different set of values assigned to the variables of the other object. Creating an object from a class is said to be instantiating the object. Even if two different objects have the same values for their variables, these objects are different entities, identified by different names in the program. The variables for an object and its corresponding class are called data members. The functions of an object and its corresponding class are called member functions. Data members and member functions are called members. The word access means to read or change the value of a variable, and it also means to use a function. C++ access specifiers are the words, “private,” “protected,” and “public.” They decide whether a member can access other members of its class, or if a function or operator outside the class and not belonging to the class can access any member of the class. They also decide whether a member of a derived (child) class can access a member of a parent class. Basic knowledge of C++ is required to understand this article and to test the code provided.

  • Compiling Code in Parallel using Make – Linux Hint

    Whoever you ask how to build software properly will come up with Make as one of the answers. On GNU/Linux systems, GNU Make [1] is the Open-Source version of the original Make that was released more than 40 years ago — in 1976. Make works with a Makefile — a structured plain text file with that name that can be best described as the construction manual for the software building process. The Makefile contains a number of labels (called targets) and the specific instructions needed to be executed to build each target. Simply speaking, Make is a build tool. It follows the recipe of tasks from the Makefile. It allows you to repeat the steps in an automated fashion rather than typing them in a terminal (and probably making mistakes while typing). Listing 1 shows an example Makefile with the two targets “e1” and “e2” as well as the two special targets “all” and “clean.” Running “make e1” executes the instructions for target “e1” and creates the empty file one. Running “make e2” does the same for target “e2” and creates the empty file two. The call of “make all” executes the instructions for target e1 first and e2 next. To remove the previously created files one and two, simply execute the call “make clean.”

  • Zeal – simple offline documentation browser

    Zeal is billed as a simple offline documentation browser. It offers easy access to a huge database of documentation, API manuals, and code snippets. The main purpose of the software is to enable you to have reference documentation at your fingertips. Let’s see how it fares.

GParted 1.2.0 Released

  • GParted 1.2.0 Released
    GParted is the GNOME Partition Editor for creating, reorganizing, and
    deleting disk partitions.
    
    The GParted 1.2.0 release includes some new features in addition to bug
    fixes, and language translation updates.
    
    Key changes include:
         - Add exFAT support using exfatprogs
         - Wait for udev change on /dev/DISK when erasing signatures
         - Don't try to mask non-existent Systemd \xe2\x97\x8f.service
    
    Visit https://gparted.org for more details.
    
  • GParted 1.2 Released With Support For exFAT File-Systems

    GParted as the widely used, GUI solution for managing Linux partitions/file-systems on the Linux desktop now finally supports dealing with exFAT file-systems. Since Linux 5.7 has been the modern exFAT file-system driver from Samsung to replace the earlier exFAT driver code following Microsoft's blessing in late 2019. That exFAT file-system driver is in increasingly good shape and continues seeing fixes/improvements with succeeding kernel releases and continues to be widely used on Android devices and elsewhere.

  • GParted 1.2 Open-Source Partition Editor Released with exFAT Support

    GParted 1.2 open-source partition editor software has been released today with initial support for the exFAT file system, as well as various other improvements. Coming a year after the previous release, GParted 1.2 is here as the first release of the popular and very handy partition editor utility to implement support for partitioning disks formatted with the exFAT file system developed by Microsoft. exFAT support is handled by using the exfatprogs command-line utility, which needs to be installed in your GNU/Linux system.