Skip to content

Instantly share code, notes, and snippets.

View lotreal's full-sized avatar
♥️
Focusing

Luo Tao lotreal

♥️
Focusing
  • chongqing, china
View GitHub Profile
;;; pbcopy.el --- Emacs Interface to pbcopy
;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
@lotreal
lotreal / Makefile
Created April 26, 2013 02:13
use define in Makefile
define REDIS1_CONF
daemonize yes
port 6379
requirepass foobared
pidfile /tmp/redis1.pid
endef
define REDIS2_CONF
daemonize yes
port 6380
@lotreal
lotreal / PlayJsonTests.swift
Last active August 29, 2015 14:03
JSON on swift
//
// PlayJsonTests.swift
// PlayJsonTests
//
// Created by 罗涛 on 14-6-26.
// Copyright (c) 2014年 罗涛. All rights reserved.
//
import XCTest
import PlayJson
@lotreal
lotreal / anyconnect.scpt
Last active August 29, 2015 14:12
anyconnect.scpt
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
@lotreal
lotreal / route.sh
Last active August 29, 2015 14:12 — forked from kevinzhow/route.sh
route = 8.0.0.0/255.0.0.0
route = 58.0.0.0/255.0.0.0
route = 23.0.0.0/255.0.0.0
route = 117.0.0.0/255.0.0.0
route = 199.0.0.0/255.0.0.0
route = 190.0.0.0/255.0.0.0
route = 198.0.0.0/255.0.0.0
route = 173.0.0.0/255.0.0.0
route = 174.0.0.0/255.0.0.0
route = 168.0.0.0/255.0.0.0
package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os/exec"
"strings"
package main
import (
"encoding/csv"
"fmt"
"io"
"reflect"
"strconv"
"strings"
)
@lotreal
lotreal / install-vagrant-vbguest.sh
Last active October 6, 2023 10:26
解决中国局域网中 vagrant plugin install vagrant-vbguest 出错的问题
#!/usr/bin/env bash
GEMS=$(cat <<EOF
childprocess-0.5.8.gem
ffi-1.9.10.gem
little-plugger-1.1.4.gem
micromachine-1.1.0.gem
multi_json-1.11.1.gem
net-ssh-2.9.2.gem
rest-client-1.6.9.gem
// Apply the scala plugin to add support for Scala
apply plugin: 'scala'
apply plugin: 'application'
version = '0.1'
configurations {
fatJar
}