Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️
Miles Richardson

Miles Richardson milesrichardson

👁️
Miles Richardson
View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active January 18, 2023 15:57
Listen to your web pages
View plink-plonk.js
@DerFichtl
DerFichtl / clamav-macosx.md
Last active February 12, 2023 21:45
clamav on mac osx - install and configure the virus scanner on mac osx
View clamav-macosx.md
layout title published tags
post
clamav - install and configure on mac osx
true
blog
clamav

Install Clamav

Install clamav via homebrew

@iddoeldor
iddoeldor / ios_ssh_over_usb_and_ipa_extractor.md
Last active October 16, 2022 05:01
and iOS related tips&tricks
View ios_ssh_over_usb_and_ipa_extractor.md

extract db

PASS=alpine; PORT=2222; sshpass -p $PASS ssh -p $PORT root@localhost -t "cp \$(find /var/mobile/Containers/Data/Application/ -name s4l*db) /private/var/tmp/skype.db" && sshpass -p $PASS scp -P $PORT root@localhost:/private/var/tmp/skype.db .

pull & read plist

/tmp$ scp -P 2222 root@localhost:/private/var/mobile/Containers/Data/Application/F8C7294C-2B60-48EC-A987-D46B9FE4DEAE/Library/Preferences/com.skype.skype.plist .
/tmp$ sudo apt-get install libplist-utils
/tmp$ plistutil -i com.skype.skype.plist | less
@bkuhl
bkuhl / .gitlab-ci.yml
Last active March 19, 2023 13:57
How to use docker-compose in GitLab CI
View .gitlab-ci.yml
# Using edge-git ensures we're always pulling the latest
# You can lock into a specific version using the *-git tags
# on https://hub.docker.com/_/docker/
image: docker:edge-git
services:
- docker:dind
# If you only need compose in a specific step definitely put this
# only in that step so it's not executed unnecessarily
before_script:
@geddski
geddski / create-react-app-for-testing
Created August 30, 2017 20:51
quick way to start testing ES6 code with a real browser (using create-react-app and Jasmine)
View create-react-app-for-testing
create-react-app comes with Jest which is awesome, but sometimes you need a real DOM/browser to test with. Here's a quick way to get up and running testing your app.
1. Create a *separate* app for testing, using create-react-app:
```
create-react-app tests
cd tests
```
2. Modify the index.html to include the Jasmine spec runner (see index.html below)
3. Modify the index.js to just run your tests rather than bootstrap a React app. (see index.js below)
View 0-rate-limiters.md

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@colophonemes
colophonemes / create_triggers
Last active March 9, 2023 23:06
Postgres TRIGGER to call NOTIFY with a JSON payload
View create_triggers
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@zelig
zelig / p2ptesting.md
Last active November 16, 2021 03:10
p2p network similation, testing and monitoring framework
View p2ptesting.md
@dpino
dpino / ns-inet.sh
Last active January 17, 2023 06:09
Setup a network namespace with Internet access
View ns-inet.sh
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".
anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
View IRC client in pure bash 4
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0