Skip to content

Instantly share code, notes, and snippets.

@laris
laris / oh-my-zsh on openwrt or lede-project.md
Last active October 25, 2018 09:32 — forked from fire1ce/oh-my-zsh on openwrt or lede-project.md
Install oh-my-zsh on openwrt/lede-project

forked from https://gist.github.com/fire1ce/65d3e370120750a5deb283abe1d74491

opkg update && opkg install ca-certificates ca-bundle zsh curl git-http
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 
#sed -i -- 's:/bin/ash:/usr/bin/zsh:g' /etc/passwd
which zsh && sed -i -- 's:/bin/ash:'`which zsh`':g' /etc/passwd

# -- reboot, all done. 
@laris
laris / openwrt-usb-serial.md
Created June 29, 2018 09:08 — forked from lanceliao/openwrt-usb-serial.md
OpenWrt USB转串口模块的调试

###安装

opkg install kmod-usb-serial kmod-usb-serial-pl2303

安装完成之后需要手动载入内核模块:

insmod usbserial
insmod pl2303
@laris
laris / supermicro-psblock-fix.expect
Created June 27, 2018 15:42 — forked from DavidWittman/supermicro-psblock-fix.expect
This expect script secures SuperMicro IPMI implementations which are vulnerable to viewing the IPMI password in plaintext on port 49152.
#!/usr/bin/expect -f
# This script secures SuperMicro IPMI implementations which are vulnerable
# to viewing the IPMI password in plaintext on port 49152. It does this by
# using the shell available in some SuperMicro BMCs to drop traffic to port
# 49152 in iptables.
#
# See http://blog.cari.net/carisirt-yet-another-bmc-vulnerability-and-some-added-extras/
# for more details on the vulnerability.
#
#!/usr/bin/env bash
# Loads and mounts an ISO over SMB via the
# SuperMicro IPMI web interface
#
# usage: supermicro-mount-iso.sh <ipmi-host> <smb-host> <path>
# e.g.: supermicro-mount-iso.sh 10.0.0.1 10.0.0.2 '\foo\bar\windows.iso'
set -x
@laris
laris / vpn-openconnect-connect-to-cisco-anyconnect.md
Created April 30, 2018 12:05 — forked from stefancocora/vpn-openconnect-connect-to-cisco-anyconnect.md
Split tunneling with openconnect - A guide on how to use openconnect to establish a vpn connection to an enterprise cisco anyconnect vpn endpoint with client side routing.

Introduction

The purpose of this short howto is to show you how to:

  • use openconnect [1] to connect to an enterprise cisco anyconnect endpoint
  • whilst minimizing the amount of traffic that your route through the vpn connection

Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.

While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.

@laris
laris / index.php
Created April 28, 2018 13:52 — forked from horsley/index.php
sms + tasker转发服务的脚本
<?php
define('APP_PATH', dirname(__FILE__));
define('DATA_FILE', APP_PATH. '/sms.htdata');
if ($_SERVER['REQUEST_METHOD'] == 'POST') { //tasker提交
if (!isset($_POST['c'])) {
die('Invalid Request!');
} else {
$data = '';
if (file_exists(DATA_FILE)) { //读入已有数据

Run Netatalk in a SmartOS zone

This guide is based on this blog post: http://blog.smartcore.net.au/blazingly-fast-afp-on-a-smartos-zone/.

Import image and create virtual machine

Find the latest image, in this case 4166f6d6-ea5f-11e4-addd-8351b159d9b6 (15.1.0), or 24648664-e50c-11e4-be23-0349d0a5f3cf (14.4.1) if you need Long Term Support (LTS).

# imgadm avail | grep base-64
@laris
laris / 0_reuse_code.js
Created December 22, 2015 08:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console