Skip to content

Instantly share code, notes, and snippets.

View owlfox's full-sized avatar
🏠
Working from home

Chen Zeren owlfox

🏠
Working from home
View GitHub Profile
@owlfox
owlfox / input_mac.md
Last active December 31, 2021 08:25
mac squirrel 輸入法筆記
@owlfox
owlfox / cp0.cpp
Created February 13, 2020 06:55
consumer, producer(?)
#include <chrono>
#include <iostream>
#include <thread>
using namespace std::chrono_literals;
const int N{8};
static int fifo[N];
volatile static unsigned int head{0}, tail{0}; // init empty
static int count{0};
@owlfox
owlfox / Vagrantfile
Created February 1, 2020 09:37
Vagrant stuff
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.insert_key = false
config.vm.define 'simplefs' do |fs|
fs.vm.box = "ubuntu/bionic64"
fs.vm.network "private_network", ip: "192.168.168.168"
fs.ssh.forward_agent = true
fs.vm.provision "shell", inline: <<-SHELL
# Prefix to C-a
set -g prefix C-a
# remove the original prefix binding
unbind-key C-b
# make it responsive?
set -g escape-time 1
set -g base-index 1
setw -g pane-base-index 1
@owlfox
owlfox / .vimrc
Last active February 4, 2020 12:30
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@owlfox
owlfox / .zshrc
Created January 15, 2020 13:27
zsh
# 設定 zsh 色調
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="sunaku"
@owlfox
owlfox / crawler.py
Created December 12, 2019 02:49
104 scrapy spider / 爬蟲
# -*- coding: utf-8 -*-
import scrapy
import json
class CrawlerSpider(scrapy.Spider):
name = 'crawler'
allowed_domains = ['104']
start_urls = [
'https://www.104.com.tw/company/ajax/joblist/5t7gcns?roleJobCat=0_0&area=0&page=1&pageSize=100&order=8&asc=0&',
'https://www.104.com.tw/company/ajax/joblist/5t7gcns?roleJobCat=0_0&area=0&page=2&pageSize=100&order=8&asc=0&'
@owlfox
owlfox / tw.json
Created November 5, 2019 05:09
terria.js catalog example file with a Taiwan wms service
{
"corsDomains": [],
"homeCamera": {
"north": 25,
"east": 122,
"south": 21.5,
"west": 120
},
"baseMapName": "Australian Topography",
"initialViewerMode": "3dSmooth",
@owlfox
owlfox / open-vm-tools-vmware-ubuntu-sharing.md
Created October 23, 2019 04:21 — forked from darrenpmeyer/open-vm-tools-vmware-ubuntu-sharing.md
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work with Ubuntu 16 LTS branches and Ubuntu 17.10)

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other