Skip to content

Instantly share code, notes, and snippets.

@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 / 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"
@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 / fetch-ses-email.sh
Created July 17, 2020 16:21 — forked from danmaas/fetch-ses-email.sh
Fetch emails from Amazon S3 and feed to procmail
#!/bin/bash
# Fetch emails from Amazon S3 (deposited by the Amazon SES receiver's S3 action)
# and feed to procmail. In the spirit of fetchmail, but using S3 instead of SMTP.
BUCKET=my-bucket-name
export AWS_PROFILE=my-aws-profile
PROCMAIL="/usr/bin/procmail"
@karnauskas
karnauskas / .slate
Created June 28, 2020 03:57 — forked from alienlebarge/.slate
My Slate configuration file. Find more info about Slate here https://github.com/jigish/slate/
# url: https://gist.github.com/alienlebarge/6808785
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config windowHintsShowIcons true
@karnauskas
karnauskas / pysyslog.py
Last active June 14, 2020 11:11 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python3
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = '/tmp/pysyslog.log'
@karnauskas
karnauskas / lsniffer.c
Created March 26, 2020 00:45 — forked from fffaraz/lsniffer.c
Packet Sniffer Code in C using Linux Sockets | http://www.binarytides.com/packet-sniffer-code-c-linux/
/*
Packet sniffer using libpcap library
*/
#include<pcap.h>
#include<stdio.h>
#include<stdlib.h> // for exit()
#include<string.h> //for memset
#include<sys/socket.h>
#include<arpa/inet.h> // for inet_ntoa()
@karnauskas
karnauskas / pipeline-build-with-jobs-template.yaml
Created January 4, 2020 22:15 — forked from justinyoo/pipeline-build-with-jobs-template.yaml
Azure DevOps Pipelines Refactoring Technics
# pipeline.yaml
...
stages:
...
- stage: BuildWithJobsTemplate
displayName: 'Build with Jobs Template'
variables:
- name: Greeting
value: 'Hello World'