This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # castanet.py: Script to connect a chromecast to a WiFi network. | |
| # | |
| # Allows you to put your Chromecast on WiFi and do Chromecast initial setup | |
| # without using the Google Home app at all, just using a normal computer. | |
| # | |
| # You do need your Chromecast to be on Ethernet, or (untested) to join its setup WiFi | |
| # network with your PC, and you also need to find out its IP yourself with e.g. | |
| # Wireshark. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| START_ID=300000000 | |
| GLOBAL_END_ID=478367875 | |
| CHUNK_SIZE=${BATCH_SIZE:-500000} | |
| JSON_CONDITION='{"read": true}' | |
| PAUSE=30 | |
| DRY_RUN=false | |
| if [[ "$1" == "--dry-run" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Podemos separar la definición de las constantes | |
| // en un archivo .H a parte e incluir después | |
| #define MODE_SHIT 0 | |
| #define MODE_STORAGE 1 | |
| #define KEYDOWN_THRESHOLD 1500 | |
| #define LCD_DISPLAY_DELAY 1000 | |
| void display(int x, int y, char *string) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import re | |
| import os | |
| handler = open("index.html", "r") | |
| data = handler.readlines() | |
| expression = re.compile(r'".*/(pc-engine-fan-.*)/.*"') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| from html.parser import HTMLParser | |
| class MyHTMLParser(HTMLParser): | |
| detected_season = None | |
| detected_chapter = None | |
| current_season = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Disclaimer: it's your funeral | |
| APP_PROCESS_NAME="Pritunl" | |
| DAEMON_PATHS=( "/Library/LaunchAgents/com.pritunl.client.plist" \ | |
| "/Library/LaunchDaemons/com.pritunl.service.plist" \ | |
| "/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist" \ | |
| "/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import requests | |
| from requests_aws4auth import AWS4Auth | |
| # Origin: host = 'https://my-elasticsearch-endpoint.com/' | |
| # Destination: | |
| host = 'https://my-elasticsearch-enpoint-destination.com/' | |
| region = 'eu-west-1' # For example, us-west-1 | |
| service = 'es' | |
| credentials = boto3.Session().get_credentials() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This is just the JavaScript side, so an HTML must be created with a canvas element. | |
| * Originally published by @NoahYamamoto | |
| */ | |
| function StartMouseTrail() { | |
| const canvas = document.getElementById("canvas"); | |
| const ctx = canvas.getContext("2d"); | |
| // Get proper height and width for canvas, then set resize handler. | |
| canvas.width = window.innerWidth; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Originally created by @jake_albaugh (Twitter) | |
| * UTF8 characters starting from "\u2581" | |
| */ | |
| const l = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]; | |
| const x = new AudioContext(); | |
| const a = x.createAnalyser(); | |
| a.fftSize = 32; | |
| const d = new Uint8Array(16); |
NewerOlder