Skip to content

Instantly share code, notes, and snippets.

View erfanio's full-sized avatar

Erfan erfanio

  • Melbourne, Australia
View GitHub Profile
@erfanio
erfanio / vpn_setup.sh
Last active April 24, 2023 13:59
Setup v2ray on Ubuntu
# install v2ray
git clone https://github.com/v2fly/fhs-install-v2ray.git
cd fhs-install-v2ray/
bash install-release.sh
cd ..
sudo systemctl enable v2ray
# install caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
@erfanio
erfanio / PKGBUILD
Created November 14, 2019 01:35
Latest version of Charles on AUR
# Maintainer: Jiabao Lin <me at leolin dot cn>
# Contributor: Jan-Erik Rediger <badboy at archlinux dot us>
# Contributor: Alexander Baldeck <lex@tentriplenine.com>
pkgname=charles
pkgver=4.5.4
pkgrel=0
pkgdesc="Web debugging proxy application"
arch=(any)
url="http://www.charlesproxy.com"
@erfanio
erfanio / chunck-response.js
Last active September 26, 2017 14:03
Send response in chunks
const express = require('express');
const app = express();
const wait = (sec) => new Promise((res, rej) => setTimeout(res, sec*1000));
app.get('/yes', (req, res) => {
// 8 sec for header
wait(8)
// 8 * 2 = 16 sec for body
.then(() => {

Keybase proof

I hereby claim:

  • I am erfanio on github.
  • I am erfanio (https://keybase.io/erfanio) on keybase.
  • I have a public key whose fingerprint is BC83 9BE2 FE79 4C15 B777 D5F2 8127 16D3 8981 D059

To claim this, I am signing this object:

@erfanio
erfanio / dim-screen.sh
Created May 14, 2017 11:24
xss-lock fading screen improved
#!/bin/bash
# adapted from xss-lock documantation
# https://bitbucket.org/raymonad/xss-lock/src/1e158fb20108058dbd62bd51d8e8c003c0a48717/doc/dim-screen.sh
# Brightness will be lowered to this value.
min_brightness=0
# Set -time and -steps for fading
# to $min_brightness here. Setting steps to 1 disables fading.
@erfanio
erfanio / template.js
Last active January 21, 2016 19:45
jquery plugin template
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ($) {
var privateMethod = function () {
// ...
};
var Plugin = function (element, options) {
// `this` refers to a `Plugin` intance
@erfanio
erfanio / chrome_gpu
Created September 5, 2015 08:57
Chromium redraw bug chrome://gpu info
Graphics Feature Status
Canvas: Software only, hardware acceleration unavailable
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Rasterization: Software only. Hardware acceleration disabled
Video Decode: Software only, hardware acceleration unavailable
Video Encode: Hardware accelerated