Skip to content

Instantly share code, notes, and snippets.

@oofnikj
oofnikj / answerfile
Last active July 20, 2024 07:10
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@GabrielMMelo
GabrielMMelo / sudo-termux
Created January 22, 2019 12:33
Install sudo in Termux (Android)
apt install git
git clone https://gitlab.com/st42/termux-sudo
cd termux-sudo
cat sudo > /data/data/com.termux/files/usr/bin/sudo
chmod 700 /data/data/com.termux/files/usr/bin/sudo
@tazjel
tazjel / letsencrypt_2017.md
Created November 27, 2017 18:53 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@titangene
titangene / index.html
Last active January 5, 2018 16:40
Web × Arduino - Timeout (LED matrix, Google Voice)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Webduino Blockly Timeout Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script>
<script src="https://blockly.webduino.io/webduino-blockly.js"></script>
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script>
@titangene
titangene / index.html
Last active January 5, 2018 16:40
Web × Arduino - Timeout (LED matrix)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Webduino Blockly Timeout Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script>
<script src="https://blockly.webduino.io/webduino-blockly.js"></script>
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script>
@matdombrock
matdombrock / Python-Arduino.md
Last active May 12, 2024 05:14
Simple Arduino Serial Monitor - Python

what's this??

A simple set of scripts for getting output from an Arduino to act is input for Python.

how to use?

  • Install python3
  • Install pyserial
  • adjust monitor.py to include your COM location as the COM variable (ie COM3 or /dev/ttyACM0)
  • run with python monitor.py --monitor (You may have to run as root on linux)

what are these numbers?

@MarkDunne
MarkDunne / scraper.py
Created March 8, 2017 09:50
Scraper for food hygiene dataset
import requests
import pandas as pd
from bs4 import BeautifulSoup
categories = {
'7846': 'Mobile caterer',
'7838': 'Farmers/growers',
'14': 'Importers/Exporters',
'7843': 'Pub/bar/nightclub',
'4613': 'Retailers - other',
@samgooi4189
samgooi4189 / BCM43228reinstallDriver
Last active March 18, 2024 21:13
Fixing BCM43228 loading wrong driver
Under lspci -vv, I saw my wifi card bcm43228 is using wl module, but it is working weirdly, so I go inspect dmesg and found:
[ 17.135645] wl: module license 'MIXED/Proprietary' taints kernel.
[ 17.135648] Disabling lock debugging due to kernel taint
[ 17.137273] wl: module verification failed: signature and/or required key missing - tainting kernel
[ 17.227089] wlan0: Broadcom BCM4359 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574)
[ 17.315644] wl 0000:03:00.0 wlp3s0: renamed from wlan0
linux is loading the wrong device for my wifi card.
so I search online and found https://ubuntuforums.org/archive/index.php/t-2209676.html
In short,
@laptrinhcomvn
laptrinhcomvn / moving_from_jquery_to_vanilla.md
Last active December 10, 2016 12:16 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery to Vanilla

Events

// jQuery
$(document).ready(function() {
  // code
})

// Vanilla
@lucadealfaro
lucadealfaro / default.py
Last active May 8, 2019 15:05
A shopping cart implementation using vue.js, stripe, and web2py
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# -------------------------------------------------------------------------
# Sample shopping cart implementation.
# -------------------------------------------------------------------------
import traceback
def index():