Skip to content

Instantly share code, notes, and snippets.

@arvati
arvati / install Anbox on debian buster.txt
Last active February 5, 2024 21:36
Install Anbox on Debian Buster and use android apps
sudo snap install --devmode --beta anbox
snap restart anbox.container-manager
sudo apt install android-tools-adb anbox
ls /lib/modules/`uname -r`/kernel/drivers/android/binder_linux.ko
ls /lib/modules/`uname -r`/kernel/drivers/staging/android/ashmem_linux.ko
sudo modprobe ashmem_linux
sudo modprobe binder_linux
@skyzh
skyzh / tpo.js
Created December 29, 2018 09:01
Extract TPO tests from "Xiao Zhan TOEFL"
const QUESTIONS = require('./t_question.json');
const ITEMS = require('./t_questionItem.json');
const ANSWERS = require('./t_answer.json');
const _ = require('lodash');
const result = _.map([13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], TPO_CNT => {
let questions = _.filter(QUESTIONS, question => question.app_name_sub == `tpo${TPO_CNT}` && question.passage == 'listening');
let items = _.map(questions, question =>
_.chain(ITEMS)
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,
@eltechno
eltechno / tor-openvpn.sh
Created December 13, 2017 22:47 — forked from kremalicious/tor-openvpn.sh
Install and configure Tor as proxy for all OpenVPN server traffic
# what we want:
# client -> OpenVPN -> Tor -> Internet
# Install & configure OpenVPN
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
# assumed OpenVPN configuration
# 10.8.0.1/24-Subnet
# tun0-Interface
@vipulasri
vipulasri / ImageCompression
Created December 19, 2015 06:01
Whatsapp Like Image Compression
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.media.ExifInterface;
import android.os.AsyncTask;
import android.os.Environment;
@samklr
samklr / install-proto.sh
Created April 20, 2015 08:19
Install Protobuf debian ...
#! /bin/bash
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar xzf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
sudo apt-get update
sudo apt-get install build-essential
sudo ./configure
sudo make
sudo make check
sudo make install
@catehstn
catehstn / AndroidOneColorImage.java
Last active May 27, 2024 12:11
Android create one color image
/**
* A one color image.
* @param width
* @param height
* @param color
* @return A one color image with the given width and height.
*/
public static Bitmap createImage(int width, int height, int color) {
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
@yanofsky
yanofsky / LICENSE
Last active October 17, 2024 22:49
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit