Skip to content

Instantly share code, notes, and snippets.

View maietta's full-sized avatar

Nick Maietta maietta

View GitHub Profile
@maietta
maietta / gist:7f8a3c3c9a8676f88743
Created February 7, 2016 18:46
Just a Gist for testing
This is just a Gist that i want to show off on my personal websites. These are where i will be creating a library of useful information
and code, including possible plugins for Commnetivity.
@maietta
maietta / cloudflare_get_zones.php
Created June 13, 2016 21:15
CloudFlare PHP Sample Get Fresh list of DNS Zones
<?php
header("Content-Type: application/json");
$curl = curl_init();
$query_array = array(
"a"=>"zone_load_multi"
,"tkn"=>"8fd535bb...11dbbcdab"
,"email"=>"user@domain.tld"
);
@maietta
maietta / example-dynamic.php
Created June 14, 2016 23:30
NOAA/Weather Widget Startpoint (with simple cache mechanism)
<?php
$cache_file = "/home/cpaneluser/public_html/weather.json";
if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 60 * 5 ))) {
// Cache file is less than five minutes old.
// Don't bother refreshing, just use the file as-is.
$file = file_get_contents($cache_file);
@maietta
maietta / remove_containers_that_are_dangling.txt
Last active June 23, 2016 18:17
Removing dangling container images
To delete all your exited containers.
% docker ps -a -q --filter "status=exited" | xargs docker rm
And to then delete all your untagged images.
% docker rmi `docker images -q --filter "dangling=true"`
To list drives by UUIDs
sudo blkid
/dev/sda1: UUID="38159b38-18fc-4511-81eb-a0e0fbf35f84" TYPE="ext2" PARTUUID="23c65b5b-01"
/dev/sda5: UUID="Afr241-YeaV-VvzI-KwGm-TFDv-pC2s-bIAuRy" TYPE="LVM2_member" PARTUUID="23c65b5b-05"
/dev/sdb: UUID="92604d6f-b523-46e7-9b42-0e36946d299f" SEC_TYPE="ext2" TYPE="ext3"
/dev/mapper/bigfoot--1--vg-root: UUID="12747bcd-ce80-46be-a511-776150125d23" TYPE="ext4"
/dev/mapper/bigfoot--1--vg-swap_1: UUID="fa7cd8db-4abc-4654-832e-1c31863db2c3" TYPE="swap"
apt-get update && \
sudo apt-get install linux-image-extra-virtual apparmor lxc cgroup-lite docker.io && \
sudo update-rc.d docker defaults && \
sudo groupadd docker && \
sudo chown root:docker /var/run/docker.sock && \
sudo chown maietta:docker /var/run/docker.sock && \
sudo usermod -aG docker maietta && \
sudo service docker start
@maietta
maietta / Install_tmux
Created July 15, 2016 21:15 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@maietta
maietta / curl_all.sh
Created July 29, 2016 02:38 — forked from antonbabenko/curl_all.sh
Curl list of urls and save http response code & times (useful for cache warmup)
#!/bin/bash
while read LINE; do curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{time_starttransfer} %{url_effective}\n' "$LINE" >> urls_result.txt done < fiddler.txt
<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
@maietta
maietta / gist:0debb4fc1f612792f00708b73035e7ff
Created August 4, 2016 18:15
Bash command to get IP's of Tor exit nodes
curl https://check.torproject.org/exit-addresses | awk '/^ExitAddress/' | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+' > $PWD/tor-exit-addresses