Skip to content

Instantly share code, notes, and snippets.

View gregorycoleman's full-sized avatar

gregorycoleman

View GitHub Profile
@gregorycoleman
gregorycoleman / following.py
Created January 6, 2023 08:48 — forked from zedeus/following.py
Fetch Twitter following list
import requests, re, sys
url = "https://mobile.twitter.com/{}/following"
cursor = ""
usernames = []
first = True
if len(sys.argv) < 2:
print("Usage: python followers.py <username>")
quit(1)
@gregorycoleman
gregorycoleman / followers.py
Created January 6, 2023 08:47 — forked from kylemcdonald/followers.py
Loads a list of followers from the Twitter REST API and steps through them, saving basic information about their follower and friend counts.
import simplejson as json
import urllib
followers = json.load(open("followers.json"))["ids"]
offset = 100
alldata = []
csv = "name\tfollowers\tfriends\tstatuses\tfollowing\n"
for i in range(1+len(followers) / offset):
@gregorycoleman
gregorycoleman / readme.md
Created June 20, 2020 02:29 — forked from troyfontaine/readme.md
Logging SFTP interactions on a Chrooted User in Ubuntu 14.04

How to setup SFTP Logging on Ubuntu 14.04 for a Chrooted User

Prerequisites: Using internal-sftp for sftp; rsyslog for logging

Step 1. Set up your chrooted directories

sudo mkdir /sftp/myshare
sudo mkdir /sftp/myothershare

Step 2. Create your groups for your chrooted users

@gregorycoleman
gregorycoleman / __init__.py
Created February 6, 2019 14:59 — forked from nacx/__init__.py
Pluggable command line tool
import os
# Automatically set the __all__ variable with all
# the available plugins.
plugin_dir = "plugins"
__all__ = []
for filename in os.listdir(plugin_dir):
filename = plugin_dir + "/" + filename
@gregorycoleman
gregorycoleman / Jenkinsfile
Created August 5, 2018 06:26 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@gregorycoleman
gregorycoleman / pgsql-docker
Created February 2, 2018 02:11 — forked from bobmaerten/pgsql-docker
Start/Stop/Status Shell script for managing docker-postgresql container from @kamui
#!/usr/bin/env bash
PGSQL_DATA_PATH='/data/pg'
SERVER_CONTAINER="postgresql-server"
DATA_CONTAINER="postgresql-data"
function getStatus(){
CONTAINER_ID=$(docker ps -a | grep -v Exit | grep $SERVER_CONTAINER | awk '{print $1}')
if [[ -z $CONTAINER_ID ]] ; then
echo 'Not running.'
@gregorycoleman
gregorycoleman / show-indexes.js
Created January 21, 2018 06:27
wget -qO- http://goo.gl/????? | mongo --quiet <db-name>
#You can also output all your indexes together with their size:
rs.slaveOk();
db.getCollectionNames().forEach(function(coll) {
print("db." + coll + ".ensureIndex(" + tojson(index.key) + ")");
db.[coll].stats().indexSizes
});
@gregorycoleman
gregorycoleman / README
Created December 3, 2017 21:23 — forked from sasha-id/README
MongoDB multiple instance upstart scripts: mongodb, mongod --configsvr and mongos
MongoDB upstart scripts for Ubuntu.
Run following commands after installing upstart scripts:
ln -s /lib/init/upstart-job /etc/init.d/mongoconf
ln -s /lib/init/upstart-job /etc/init.d/mongodb
ln -s /lib/init/upstart-job /etc/init.d/mongos
To start services use:
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
@gregorycoleman
gregorycoleman / ubuntu-eol.md
Created November 17, 2017 14:10 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]