Skip to content

Instantly share code, notes, and snippets.

View ad-m's full-sized avatar
🐱
😺

Adam Dobrawy ad-m

🐱
😺
View GitHub Profile
@ad-m
ad-m / cloudflare-initial-scan.txt
Created November 5, 2018 13:15
List DNS queries for initial CloudFlare scan when new domain added
$ tcpdump -r file.pcap udp port 53 | grep '> host-62-181-8-31.domain:' | awk '{print $7" "$8}'
reading from file file.pcap, link-type EN10MB (Ethernet)
[1au] SOA?
[1au] AAAA?
[1au] A?
NS? ukhvrg3huqbjjec.info.pl.
A? ukhvrg3huqbjjec.info.pl.
CNAME? ukhvrg3huqbjjec.info.pl.
A? *.ukhvrg3huqbjjec.info.pl.
A? mail.ukhvrg3huqbjjec.info.pl.
@ad-m
ad-m / signature.js
Created October 20, 2018 03:05
GSuite Signature sync - Unifies signatures of all users by copying the signature of the selected user.
const {google} = require('googleapis');
const {JWT} = require('google-auth-library');
const MasterUser = "[email protected]";
const OrganizationDomain = 'siecobywatelska.pl';
function getAuthClient(options) {
const authClient = new JWT(Object.assign({}, {
email: 'vacationreplymanager@vacationreplymanager.iam.gserviceaccount.com',
keyFile: 'keys/vacationreplymanager-7dbf49809e60.json',
const querystring = require('querystring');
const date = require('./date');
const repo = require('./repo');
const getBadgeUrl = (subject, status, color) => {
return `https://img.shields.io/badge/${querystring.escape(subject)}-${querystring.escape(status)}-${querystring.escape(color)}.svg`;
};
const getRepoBadgeUrl = async (user, repo_name) => {
try {
function git_push_delayed(){
TMP_BRANCH=$(date +"tmp-%s");
CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD);
git checkout -b "$TMP_BRANCH" "$CUR_BRANCH";
git branch -D "$CUR_BRANCH";
git checkout -b "$CUR_BRANCH" "origin/master";
git log "$TMP_BRANCH"...origin/master --format="oneline" --reverse | awk '{print $1}' | while read COMMIT_ID; do
git merge "$COMMIT_ID";
git push origin "$CUR_BRANCH" --force;
done;
@ad-m
ad-m / diff
Created May 24, 2018 09:35
SumoLogic installer changes
A /SumoCollector.sh
C /etc
C /etc/.pwd.lock
C /etc/group
A /etc/group-
C /etc/gshadow
A /etc/gshadow-
C /etc/init.d
C /etc/init.d/.depend.boot
C /etc/init.d/.depend.start
@ad-m
ad-m / run.sh
Created April 23, 2018 01:15
Getting Docker running
#!/bin/sh
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common;
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
@ad-m
ad-m / Vagrantfile
Created October 12, 2017 20:53
Zabbix server in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@ad-m
ad-m / .bashrc
Created September 8, 2017 20:19
manage.py ()
{
if [ -f "manage.py" ]; then
manage="manage.py";
else
if [ -f "../manage.py" ]; then
manage="../manage.py";
else
if [ -f "../../manage.py" ]; then
manage="../../manage.py";
@ad-m
ad-m / foreign_key_controller.cs
Last active September 4, 2017 22:57
ASP.Net Cheatsheet
// both POST and GET
ViewBag.SaleSelect = new SelectList(db.Salas, "ID", "NrSali");
@ad-m
ad-m / .gitignore
Last active November 26, 2017 23:23
*.csv
.idea
*.pyc
*token*