Skip to content

Instantly share code, notes, and snippets.

@yosida95
yosida95 / vim.rest
Last active July 21, 2023 09:34
Building Vim 8.0 from Source Code on Ubuntu 14.04
$ sudo apt-get build-dep vim-nox

$ sudo apt-get install luajit libluajit-5.1-dev libncurses-dev libperl-dev python3-dev ruby-dev

$ git clone https://github.com/vim/vim.git

$ cd ./vim
@yosida95
yosida95 / gist:4186224
Created December 2, 2012 00:55
Task Reminder with Google Apps Script
var USERS_SHEET_NAME = 'users',
TASKS_SHEET_NAME = 'tasks',
SPREADSHEET_URI = 'スプレッドシートのURI';
var getEmailByNickname = (function(){
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var usersSheet = spreadsheet.getSheetByName(USERS_SHEET_NAME);
var userEmailTable = {};
for(var i = 2; i <= usersSheet.getLastRow(); ++i){
@yosida95
yosida95 / nginx.conf
Created February 9, 2022 18:07
NGINX config pitfall
http {
server {
server_name example.net;
listen 80;
types {}
default_type text/plain;
set $12 "Hello";
@yosida95
yosida95 / README.md
Created January 12, 2022 14:08
CO2-mini
$ sudo apt-get install \
    python3-dev \
    librrd-dev \
    libudev-dev \
    libusb-1.0-0-dev
$ python3 -m pip install wheel
$ python3 -m pip install hidapi rrdtool
#-*- coding: utf-8 -*-
import re
import time
import email
from getpass import getpass
from threading import (
Thread,
Event
)
@yosida95
yosida95 / dmarc.go
Created June 1, 2021 18:08
DMARC report parser
package main
import (
"context"
"encoding/xml"
"flag"
"log"
"net"
"os"
"time"
@yosida95
yosida95 / vlcloop.scpt
Last active June 10, 2020 05:49
Jump VLC position to the beginning of the track and go to next track on the playlist when reached the end of the current track
#!/usr/bin/osascript
on run argv
set startMargin to 55
set stopMargin to 115
if (count of argv) = 0 then
# use the default
else if (count of argv) = 2 then
set startMargin to item 1 of argv
@yosida95
yosida95 / com.yosida95.duplicity-backup.plist
Last active May 22, 2020 14:50
Take macOS backups at every 4:00 a.m. using Duplicity
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yosida95.duplicity-backup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/yosida95/.local/bin/duplicity-backup.sh</string>
</array>
@yosida95
yosida95 / supervisor_monitor.py
Last active May 22, 2020 14:46
Send email notifications on Supervisor programs died/failed/exited
#!/usr/bin/python
# -*- coding: utf-8 -*-
import contextlib
import signal
import sys
from email.mime.text import MIMEText
from datetime import datetime
from smtplib import SMTP
from threading import Event
@yosida95
yosida95 / chromedp.go
Created May 22, 2020 14:36
Save a webpage as a PDF file using Headless Google Chrome with Go's chromedp/chromedp
package main
import (
"context"
"flag"
"io/ioutil"
"github.com/chromedp/cdproto/page"
"github.com/chromedp/cdproto/runtime"
"github.com/chromedp/chromedp"