Skip to content

Instantly share code, notes, and snippets.

View paulomcnally's full-sized avatar
:octocat:
JS

Paulo McNally paulomcnally

:octocat:
JS
View GitHub Profile
package nd.sd.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.telephony.TelephonyManager;
import android.util.Log;
public class Operator {
public static void info(Context context) {
@paulomcnally
paulomcnally / gist:bff698549d71854c8119fe13488a9250
Last active December 15, 2023 06:38
PN532 on Raspberry Pi With Ubuntu for Raspberry Pi 3
```
$ sudo apt install gcc
$ sudo apt install make
$ sudo apt-get update
$ sudo apt-get install libusb-dev libpcsclite-dev i2c-tools
```
```
cd ~
wget http://dl.bintray.com/nfc-tools/sources/libnfc-1.7.1.tar.bz2
@paulomcnally
paulomcnally / lily58-keyboard.org
Created August 11, 2020 23:33 — forked from braun-steven/lily58-keyboard.org
Lily58 Pro Parts List
var goog = goog || {};
goog.global = this;
goog.isDef = function(val) {
return void 0 !== val;
};
goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {
var parts = name.split("."), cur = opt_objectToExportTo || goog.global;
parts[0] in cur || !cur.execScript || cur.execScript("var " + parts[0]);
for (var part;parts.length && (part = parts.shift());) {
!parts.length && goog.isDef(opt_object) ? cur[part] = opt_object : cur = cur[part] ? cur[part] : cur[part] = {};
{
"kind": "youtube#searchListResponse",
"etag": "\"BDC7VThyM9nfoSQm1_kOyhtJTEw/0MX1aovXL6JrPZ_tgqxLQ_YhGWI\"",
"nextPageToken": "CAIQAA",
"pageInfo": {
"totalResults": 680321,
"resultsPerPage": 2
},
"items": [
{
@paulomcnally
paulomcnally / usb-modeswitch-huawei-e303-debian-jessie-lite-raspberry.md
Created November 19, 2022 19:31 — forked from plieningerweb/usb-modeswitch-huawei-e303-debian-jessie-lite-raspberry.md
Debug USB-Modeswitch (Raspberry with debian jessi lite) and Huawei E303

test if modeswitch works

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243123456780000000000000a11062000000000000100000000000000"

if yes than usually you would do this (but for me it did not work)

#edit config file
/etc/usb_modeswitch.conf
@paulomcnally
paulomcnally / gist:9b0fd29d962f8199786b0587b1efe6b5
Created November 30, 2021 03:00 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@paulomcnally
paulomcnally / ffmpeg_mkv_mp4_conversion.md
Created May 31, 2021 19:16 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@paulomcnally
paulomcnally / nginx.conf
Created April 30, 2021 16:08 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {