Skip to content

Instantly share code, notes, and snippets.

View dantebarba's full-sized avatar

Dante Barba dantebarba

View GitHub Profile
@inadarei
inadarei / ipaddressclasses.md
Last active December 28, 2020 17:43
IP Address Classes, CIDRs and Network Masks

Network Classes

IP Addresses identify both a network as well as host on a network. Depending on the class of a network, certain amount of bits in the IP (32 bits overall) are allocated for network adressing and the rest is for: adressing the host on the network.

  1. Class A: first octet is network, last three: host
  2. Class B: first two octets are for network, last two: host
  3. Class C: first three octets are for network, only last octet is for host.

Furthermore, looking at the IP itself, you can tell which class of IP it is, using the following rules:

@aweijnitz
aweijnitz / install_CUPS_all_defaults.sh
Last active November 12, 2023 19:55
Installing CUPS printer on Debian and add PDF printer
#!/bin/bash
sudo apt-get -y install cups
sudo apt-get -y install cups-pdf
# add pdf printer to cups
# - named files end up in ~/PDF/
# - unnamed files are stored in /var/spool/cups-pdf/ANONYMOUS/, such as PDF:s created by streaming bytes over an API
sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd
@gbrks
gbrks / snapraid-sync
Last active July 3, 2023 15:37
SnapRAID sync and scrub: script and systemd timers to run nightly
#! /bin/bash
#######################################################################
# this is a helper script that keeps SnapRAID parity info in sync with
# your data. Here's how it works:
# 1) it first calls diff to figure out if the parity info is out of sync
# 2) if there are changed files (i.e. new, changed, moved or removed),
# it then checks how many files were removed.
# 3) if the deleted files exceed X (configurable), it triggers an
# alert email and stops. (in case of accidental deletions)
# 4) otherwise, it will call sync.
@skamithi
skamithi / create-ansible-playbook-template.sh
Created April 23, 2014 01:59
script to create ansible playbook structure
#!/bin/bash
# Script to create ansible playbook directories
# define your roles here
roles=(upgrade packages)
directories=(tasks handlers files default vars templates)
# create playbook
mkdir global_vars
@epicserve
epicserve / svn_to_git.rst
Created September 15, 2011 17:17
Convert SVN Repositories to Git Repositories

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

: