Skip to content

Instantly share code, notes, and snippets.

View estevesd's full-sized avatar

David Esteves estevesd

  • http://wicastr.com
  • London
View GitHub Profile
@estevesd
estevesd / gencert.sh
Created May 12, 2022 14:08
Generate CA and SSL self signed certificates with alternative names and wildcard
#!/bin/bash
# to test the certificate run : openssl x509 -in certs/example.com.crt -text -noout
DOMAIN='example.com'
CERTS_COUNTRY='US'
CERTS_STATE='California'
CERTS_CITY='San Francisco'
CERTS_ORGANIZATION='Organisation'
CERTS_ORGANIZATIONAL_UNIT='Organisational unit'
CA_PASS='ca key password'
#!/bin/bash
# WORK IN PROGRESS - NOT FULLY TESTED
# To install aliases
# bash bash_aliases.sh filename1 filename2 filenamex
# bash bash_aliases.sh git npm docker
# Mac Os setup
# https://ss64.com/osx/syntax-bashrc.html
if [[ `uname` == Darwin* ]] && ! grep "bash-aliases" ~/.bash_profile ;then
echo '[ -f ~/.bash-aliases ] && . ~/.bash-aliases' >> ~/.bash_profile
@estevesd
estevesd / mount_img.sh
Created August 21, 2019 12:36
Mount and manage image files on Linux
#!/bin/bash
IMG=$1
if [ -z "$IMG" ];then
echo no image file selected
exit 1
fi
if echo "$IMG" | grep " " &>/dev/null;then
echo "Remove spaces in file name"
#!/bin/bash
# on minimal Debian stretch installation with only ssh installed
# https://github.com/systemd/mkosi
apt-get install ovmf python3-pip debootstrap dosfstools git-core gnupg squashfs-tools tar systemd-container qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils libguestfs-tools genisoimage
git clone https://github.com/systemd/mkosi.git mkosi
cd mkosi
./setup.py install
mv /etc/network/interfaces /root
#!/bin/bash
# Getting floating date, calendar start and end date for day, week, month and year
# main goal is to get dates in epoch format
# the output in human readable format are mainly for debugging purpose
# NOW
function now_epoch () {
date +%s
}
function now () {
@estevesd
estevesd / jquery.plugintemplate.js
Created November 24, 2012 20:15
jQuery Plugin Template
/*!
* PLUGIN_NAME v@PLUGIN_VERSION
* PLUGIN_SITE_PATH
* PLUGIN_REPO_PATH
*
* Copyright 2012
* Released under the MIT license.
* PLUGIN_LICENSE_PATH
*
* Date: @PLUGIN_DATE