Skip to content

Instantly share code, notes, and snippets.

@dude333
dude333 / git.sh
Created February 19, 2021 15:18
Git aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@dude333
dude333 / docker-compose-master.yml
Last active December 12, 2020 20:38
PowerDNS master-slave docker compose
version: "3.7"
services:
powerdns-admin:
image: hsrnetwork/powerdns-admin:latest
hostname: powerdns-admin
restart: unless-stopped
ports:
- "80:80"
# To override the default config.py:
@dude333
dude333 / Combine.vbs
Created March 31, 2020 17:40
Combine all Excel sheets into one
' Source: https://excel.tips.net/T003005_Condensing_Multiple_Worksheets_Into_One.html
Sub Combine()
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add ' add a sheet in first place
Sheets(1).Name = "Combined"
' copy headings
@dude333
dude333 / ipv4.js
Created March 1, 2020 01:29
Handling IPv4 addresses on javascript (https://stackoverflow.com/a/53815921/276311)
let ipv4 = {
random: function (subnet, mask) {
// generate random address (integer)
// if the mask is 20, then it's an integer between
// 1 and 2^(32-20)
let randomIp = Math.floor(Math.random() * Math.pow(2, 32 - mask)) + 1;
return this.lon2ip(this.ip2lon(subnet) | randomIp);
},
ip2lon: function (address) {
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
)
@dude333
dude333 / apic_fetch.html
Created February 9, 2020 19:34
Fetch data from APIC server
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Curl</title>
<style>
html {
@dude333
dude333 / progress.go
Last active September 13, 2019 14:47
Terminal progress indicator
package main
import "fmt"
import "time"
func main() {
arr1 := ".oO0* "
arr2 := "_.-^\" "
arr3 := ".!|\"' "
arr4 := "<(|)> "