Skip to content

Instantly share code, notes, and snippets.

@karnauskas
karnauskas / config
Created November 18, 2021 00:38
.cargo/config for mips
[build]
target = "mips-unknown-linux-musl"
[target.mips-unknown-linux-musl]
linker = "/home/mk/tmp/openwrt-sdk-21.02.1-lantiq-xrx200_gcc-8.4.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/bin/mips-openwrt-linux-musl-gcc"
@karnauskas
karnauskas / PKPass.md
Created November 16, 2021 21:32 — forked from rlanyi/PKPass.md
How to create Apple PKPass .p12 certificate using Linux

How to create Apple PKPass .p12 certificate using Linux

You don't need a Mac to do this :-)

For generating PKPass files, you'll need 4 things after this tutorial:

  • Certificate Identifier (pass.com.example.www)
  • Team Identified (Organizational Unit (OU) in the cert generated by Apple)
  • The .p12 file
  • The password for the .p12 file
@karnauskas
karnauskas / sms-mailer.py
Created October 10, 2021 12:30 — forked from joneskoo/sms-mailer.py
Send unread SMS messages (from adb shell) to email
#!/usr/bin/env python3
# Joonas Kuorilehto 2013
# This script is Public Domain.
import csv
import subprocess
import pipes
from datetime import datetime
import smtplib
@karnauskas
karnauskas / autoboot
Last active August 1, 2021 05:48
Disable MacBook from starting automagically (YMMV)
#!/bin/bash
# https://www.cultofmac.com/646104/stop-macbook-autoboot-upon-opening/
set -e
readonly p=$1
if [ "$p" == "on" ]; then
sudo nvram AutoBoot=%03
elif [ "$p" == "off" ]; then
@karnauskas
karnauskas / generateAppIcon.sh
Created November 14, 2020 15:03 — forked from roblabs/generateAppIcon.sh
Generate app icons and xcassets file from a single image. To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app). Create folder there called `RawImages`. Source icon should 1024x1024 and be called appIcon.png. If th…
#!/bin/bash -e
# --------------------------------------------------------
# Generate app icons and xcassets file from a single image
# Ben Clayton, Calvium Ltd.
# https://gist.github.com/benvium/2be6d673aa9ac284bb8a
# --------------------------------------------------------
#
# Usage with an input of 1024x1024 PNG file
# generateAppIcon.sh AppIcon.png
@karnauskas
karnauskas / gen_ios_app_icon.py
Created November 14, 2020 14:38 — forked from tobyliu-sw/gen_ios_app_icon.py
Generate iOS App Icon Images Python Script
import argparse
import sys
import os
import cv2
import json
# default resized icon imag format
# could be changed to jpg
RESIZED_ICON_IMAGE_FORMAT = "png"
Port /dev/ttyUSB0, 12:11:14
Press CTRL-A Z for help on special keys
[ 9.611636] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 507
[ 9.663345] UBIFS (ubi0:2): recovery needed
[ 9.926701] UBIFS (ubi0:2): recovery completed
[ 9.929990] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[ 9.937580] UBIFS (ubi0:2): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 9.947492] UBIFS (ubi0:2): FS size: 112379904 bytes (107 MiB, 871 LEBs), journal size 5677056 bytes (5 MiB, 44 LEBs)
@karnauskas
karnauskas / cors_server.py
Last active September 14, 2020 00:28 — forked from enjalot/cors_server.py
Allow CORS with python simple http server
#!/usr/bin/env python3
import http.server as SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
@karnauskas
karnauskas / maildir2mbox.py
Last active August 14, 2020 16:22 — forked from nyergler/maildir2mbox.py
Convert maildirs (including subfolders) to mbox format
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Frédéric Grosshans, 19 January 2012
Nathan R. Yergler, 6 June 2010
This file does not contain sufficient creative expression to invoke
assertion of copyright. No warranty is expressed or implied; use at
your own risk.
@karnauskas
karnauskas / Dockerfile
Last active August 2, 2020 20:50
for building linux kernel
FROM debian:buster
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bc \
bison \
build-essential \
cpio \
fakeroot \
flex \