Skip to content

Instantly share code, notes, and snippets.

View AnneTheAgile's full-sized avatar

AnneTheAgile

  • Fan of http://www.CodeTriage.com
View GitHub Profile
@robballou
robballou / instance_name.py
Created October 17, 2011 16:55
Get the EC2 instance name
"""
Get the EC2 instance name (tag "Name") for the instance
Usage:
python instance_name.py [instance id]
On an EC2 instance, you can run:
python instance_name.py `ec2metadata --instance-id`
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
Adapted from: http://stackoverflow.com/questions/7162604/get-cached-credentials-in-powershell-from-windows-7-credential-manager
.PARAMETER TargetName
The name of the target login informations in the Windows Credential Manager
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@amokan
amokan / gist:3881064
Created October 12, 2012 19:36
jenkins-cli commands (v1.485)
build
Builds a job, and optionally waits until its completion.
cancel-quiet-down
Cancel the effect of the "quiet-down" command.
clear-queue
Clears the build queue
connect-node
Reconnect to a node
copy-job
Copies a job.

Dotfiles Lite

Taken from mathiasbynens/dotfiles. Save time and pain from customising your clean-installed Mac, install web development tools and native applications. It's straight-forward and simple, here's how you run it:

Download osx.sh and tools.sh to your desktop, open osx.sh on your favorite text editor and change these lines:

# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "Pongstr"
@cdhunt
cdhunt / Get-CredentialFromWindowsCredentialManager.ps1
Last active June 1, 2023 23:48 — forked from toburger/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC
@dutc
dutc / notes.md
Last active July 1, 2022 20:57
CPython workshop

themes

  1. CPython for greater understanding of the Python programming language (but "reference implementations always overspecify") Reading source to solve problems
  2. getting involved, contributing to the project

introduction

This workshop will cover the basics of the CPython runtime and interpreter. There is an enormous amount of material to cover, and I'll try to to rush through as much as I can.

@hmason
hmason / fetch_locu_data.py
Last active July 29, 2023 19:21
A quick script to fetch data from the locu api by query and zip code.
import sys
import os
import json
import csv
import time
import pickle
import requests
API_KEY = [YOUR API KEY GOES HERE]
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@lamw
lamw / gist:9928202
Created April 2, 2014 05:00
Parsing JSON in PowerShell using ConvertFrom-Json
$json = @"
{"A": {"property1": "value1", "property2": "value2"}, "B": {"property1": "value3", "property2": "value4"}}
"@
$parsed = $json | ConvertFrom-Json
foreach ($line in $parsed | Get-Member) {
echo $parsed.$($line.Name).property1
echo $parsed.$($line.Name).property2
}