Skip to main content


 
!The Lazy Admin Club

A shell script to display the status of all your fail2ban jails at once (works fine for me on Ubuntu): #fail2ban #serveradmin #linux #bash



 
#oop #bash #stdlib



 
#linux #bash #coutils #progress

pv must be in the pipe. progress not.
perfect for me, I always forget to add pv in the pipe :-)

^ confirmed. :-)

pv path/to/source/file.ext > path/to/dest/file.ext



 
Super impressed by ArgBash, a library for generating code to parse command line arguments in #bash. Well written, easy to use, and generates very correct code that handles nearly any kind of argument your script might need. Came in handy today.


@Gruppo Linux Como




 

Bash, OAuth and json...


This is mainly for @tony baldwin :-)

A very simple ~friendica ~friendica client, wich uses #OAuth to authenticate with the server and #JSON to get user timeline. All written in #bash. It requires only openssl and perl.

Is based on bash-oauth and JSON.sh

Find the tar.gz attached.

To install extract all files somewere in your $PATH, then create the configuration file in your $HOME:

~/.fcli.rc
friendica_url=http://kirgroup.com #no trailing slash
oauth_consumer_key='1234567890'
oauth_consumer_secret='1234567890'

Make up two values for "consumer_key" and "consumer_secret" (I used "1234567890" for both).
Go to your friendica, "Settings"->"Connected apps" -> "Add application".
Fill in your consumer key and secret, leave blank "Redirect" field, put a meaningful name, and an url to a icon you like (I used this : Immagine/foto )

Run $ flci.sh and follow instruction to authorize the application.

If everting goes well, you can see last 5 items in network page with
$ fcli.sh -c home_timeline
and you can update your status with
$ fcli.sh -c statuses_update -s "type message here"

@Arto, there should be a string after "oauth_token=" in that url. Someting is missing. Have you added the app under settings/oauth? Have you created ~/.fcli.rc with same values for key and secret as in settings/oauth ?
@Arto



 

Bash git fallback


I have a virtual machine with #debian as a #develop machine for some web-related projects (like ~friendica ~friendica).
I use #git a lot, and sometime I forgot to prefix my command with "git".
Based on this, my .bashrc function which allow me to write
$ add filename
and get
git add filename
executed.

command_not_found_handle() {

    export TEXTDOMAIN=command-not-found

    local cmd state rest
    local -i pid ppid pgrp session tty_nr tpgid

    # do not run when inside Midnight Commander or within a Pipe
    if test -n "$MC_SID" -o ! -t 1 ; then
... show more
#debian #develop #git #bash blog