Skip to content

Instantly share code, notes, and snippets.

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jokey2k
jokey2k / sshfilter.sh
Last active March 5, 2024 12:30
Tuned version of sshfilter.sh to allow for ipv6 filtering
#!/bin/bash
# based on script from http://www.axllent.org/docs/view/ssh-geoip
# License: WTFPL
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="DE EU GB"
LOGDENY_FACILITY="authpriv.notice"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <ip>" 1>&2
@Juul
Juul / amazon_fire_2015_7_inc_lineageos_install.md
Last active March 3, 2024 01:32
How to install install LineageOS on a 2015 7" Amazon Fire tablet

This is a guide for getting LineageOS (an older and unofficial version) onto an Amazon Fire 2015 7" tablet (also known as the 5th generation 7" Amazon Fire or under the internal codename "ford").

NOTE: This guide was originally written before someone figured out how to unlock the bootloader. There is now a newer method. Here it is very briefly. The old guide can be found below.

Unlocked bootloader method

First unlock the bootloader using this guide.

Once you're booted into TWRP download the latest LineageOS 14 release for your device here.

@SergioSV96
SergioSV96 / hyperion_mi_led.py
Last active December 4, 2023 13:01
A Hyperion UDP listener for Xiaomi Mi LED Smart Bulb bulbs! Just "pip install yeelight" and run with "python3 hyperion_mi_led.py PORT NAME"
import time
import yeelight
import sys
import socket
import colorsys
import argparse
from yeelight import BulbException
@n3wtron
n3wtron / exifImageMover.py
Created June 25, 2013 14:33
Python rename image based on exif datetime
#!/usr/bin/python
from PIL import Image
import sys
import time
from os import path
import os
import shutil
from optparse import OptionParser
def main():
@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@peterkuterna
peterkuterna / CursorFragmentPagerAdapter.java
Created July 19, 2012 14:20
A FragmentPagerAdapter that exposes data from a Cursor
package com.example;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseIntArray;
import android.view.ViewGroup;
@casidiablo
casidiablo / SimpleCursorLoader.java
Created September 14, 2011 20:03
Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview
/*
* Copyright 2012 CodeSlap - Cristian Castiblanco
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@greenrobot
greenrobot / AsyncTaskExecutionHelper.java
Created May 23, 2012 08:26
Helper bringing back parallel execution for AsyncTask (you are no serial execution and pseudo threading wimp, right?). Uses level 11 APIs when possible.
package de.greenrobot.util;
import java.util.concurrent.Executor;
import android.os.AsyncTask;
import android.os.Build;
/**
* Uses level 11 APIs when possible to use parallel/serial executors and falls back to standard execution if API level
* is below 11.