Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
@izifortune
izifortune / parallax effect
Created January 14, 2014 13:15
Simple parallax effect for background image
.parallax-image {
background: url() repeat center center fixed;
background-clip: padding-box;
}
@iancmyers
iancmyers / node-miner.js
Created January 23, 2014 20:46
My solution to the Stripe CTF3 level1 challenge. `node work.js`
var crypto = require('crypto');
var fs = require('fs');
var exec = require('child_process').exec;
var async = require('async');
function solve() {
async.auto({
reset: function (callback) {
exec('git fetch origin && git reset --hard origin/master && (grep -q "user-lceye6qv" LEDGER.txt || echo "user-lceye6qv: 1" >> LEDGER.txt) && git add LEDGER.txt', function (err, stdout) {
callback(null, null);
@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@eezis
eezis / hist command search
Last active October 1, 2015 08:56
Incremental Search History for the OS X Terminal (type a partial command, up arrow / down arrow to search)
@DeviaVir
DeviaVir / email.eml
Created January 8, 2015 08:39
Formal complaint to Spamhaus
Dear Spamhaus,
We would like to submit a formal complaint regarding one of your divisions, the CBL (CBL.abuseat.org), and hope you will swiftly take action regarding these practices.
Two days ago, our customers started to notify us that we were blacklisted.
The CBL had picked this up using a sinkhole, and had banned our IP's. Upon investigation we found several hacked wordpress and joomla websites, that were being abused, we cleaned these up and forced the customers to upgrade.
This seemed to not please the CBL, however, as they already enforced a 48 hour ban on all of our IP's. One IP address which was not even active the last month. Imagine our surprise when we tried to switch one out to use it. I think it's outrageous to immediately enforce a 48 hour ban on any IP connecting to the sinkhole, these IP's are used to send legitimate e-mail (usually), and all of our customers are impacted by this practice.
We would like to suggest to you to use a different practice, please do not ban IP's for 48 (!) hours
@joepie91
joepie91 / functional.js
Last active February 16, 2021 05:12
Functional programming (map, filter, reduce) in bluebird
/* Double all numbers */
Promise.map([1, 2, 3], function(num) {
return num * 2;
}).then(function(numbers) {
console.log("The final list of numbers:", numbers);
//The final list of numbers: [ 2, 4, 6 ]
});
/* Remove all the odd numbers */
Promise.filter([1, 2, 3], function(num) {
// Double all numbers
> Promise.map([1, 2, 3], function(num) { return num * 2; }).then(function(numbers) { console.log("The final list of numbers:", numbers); })
The final list of numbers: [ 2, 4, 6 ]
// Remove all the odd numbers
> Promise.filter([1, 2, 3], function(num) { return (num % 2) == 0; }).then(function(numbers) { console.log("The final list of numbers:", numbers); })
The final list of numbers: [ 2 ]
// Sum all the numbers
> Promise.reduce([1, 2, 3], function(total, num) { return total + num; }, 0).then(function(number) { console.log("The final value:", number); })
resource "aws_iam_user" "asg_healthreport" {
name = "${var.stack}-asg_healthreport"
# can't use create_before_destroy due to fixed name
}
resource "aws_iam_access_key" "asg_healthreport" {
user = "${aws_iam_user.asg_healthreport.name}"
# can't use create_before_destroy due to fixed name of user
}
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
def fib():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
def main():
i = int(raw_input())
if i is 0: