Skip to content

Instantly share code, notes, and snippets.

View realeroberto's full-sized avatar
💭
Trust your journey.

Roberto Reale realeroberto

💭
Trust your journey.
View GitHub Profile
@ddgenome
ddgenome / travis-ci-git-commit.bash
Last active February 16, 2023 06:13
Make a commit on a branch in a Travis CI build, dealing with detached HEAD state safely
#!/bin/bash
# function to make a commit on a branch in a Travis CI build
# be sure to avoid creating a Travis CI fork bomb
# see https://github.com/travis-ci/travis-ci/issues/1701
function travis-branch-commit() {
local head_ref branch_ref
head_ref=$(git rev-parse HEAD)
if [[ $? -ne 0 || ! $head_ref ]]; then
err "failed to get HEAD reference"
return 1
@frafra
frafra / mbox2html.py
Last active February 17, 2021 16:34
Mailbox to HTML conversion using Python 3 + Jinja2 in less than 100 lines (including GPLv3 license)
#!/usr/bin/env python3
#
# Copyright (C) 2016 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@ldante86
ldante86 / rot.sh
Created November 16, 2016 06:26
rotate string
#!/bin/bash -
#
# SCRIPT: rot
# AUTHOR: Luciano D. Cecere
#
########################################################################
#
# rot - rotate the alphabet and encode a string
# Copyright (C) 2014 Luciano D. Cecere <ldante86@aol.com>
#
@ldante86
ldante86 / igpay.sh
Created November 16, 2016 06:25
Text to Pig Latin
#!/bin/bash -
#
# SCRIPT: igpay
# AUTHOR: Luciano D. Cecere
# DATE: 10/18/2014-04:29:05 PM
#
########################################################################
#
# igpay - convert standard input to standard pig latin :@)
# Copyright (C) 2014 Luciano D. Cecere <ldante86@aol.com>
@ldante86
ldante86 / roman.sh
Created November 16, 2016 06:24
number to Roman Numeral
#!/bin/bash -
#
# SCRIPT: romam
# AUTHOR: Luciano D. Cecere
# DATE: 2014
########################################################################
#
# roman - convert number (1-9999) to Roman numeral
# Copyright (C) 2014 Luciano D. Cecere <ldante86@aol.com>
#
@ldante86
ldante86 / hexnote.sh
Created November 16, 2016 06:15
convert decimal to hexadecimal
#!/bin/bash -
#
# SCRIPT: hexnote
# AUTHOR: Luciano D. Cecere
########################################################################
#
# hexnote - convert base 10 integers to hexadecimal notation
# Copyright (C) 2015 Luciano D. Cecere <ldante86@aol.com>
#
# This program is free software: you can redistribute it and/or modify
@ldante86
ldante86 / mkpr.sh
Last active November 16, 2016 15:51
Create new shell project
#!/bin/bash -
# SCRIPT: mkpr
# AUTHOR: Luciano D. Cecere
# YEAR: 2016
# PURPOSE: This script creates a new shell project with common directories and files included.
# USAGE: mkpr project-name version
# NOTE: If a version number is not specified, 0.0.1 is used by default.
PROGRAM="${0##*/}"
@ldante86
ldante86 / up.sh
Created November 7, 2016 20:45
Get uptime and second conversion
#!/bin/bash -
PROGRAM="${0##*/}"
IFS="."
for i in $(cat /proc/uptime)
do
UPTIME=$i
break
done
@ldante86
ldante86 / ram.sh
Created November 7, 2016 20:08
Get ram information from /proc/meminfo
#!/bin/bash -
ram_info=/proc/meminfo
total_ram=$(bc <<< "scale=2; $(cat $ram_info | grep MemTotal | tr -d a-zA-Z:)/1024/1024")
free_ram=$(bc <<< "scale=2; $(cat $ram_info | grep MemFree | tr -d a-zA-Z:)/1024/1024")
used_ram=$(bc <<< "$total_ram-$free_ram")
echo "Total Ram: $total_ram G"
echo "Free Ram: $free_ram G"
@kylefrost
kylefrost / HOWTO.md
Last active July 31, 2021 19:24
How-To: Tweet All Commit Messages

Creating the post-commit file

Note: If you want to use your personal Twitter account to post commits, go to Step 2

  1. Create a new Twitter account for your commit messages. Example
  2. Go to http://dev.twitter.com and Sign In with your Twitter account you are posting commit messages to.
  3. Hover over your username in the top-right corner after signing in and select "My Applications"
  4. Create a new application
  5. The name, description, and site can all be whatever you want, but leave Callback URL empty
  6. Under "Application Settings" click "modify app permissions" next to "Access level"