Skip to content

Instantly share code, notes, and snippets.

View harupong's full-sized avatar

Haruo Nakayama harupong

View GitHub Profile
@harupong
harupong / gist:be8bf22b121e0bc7ea93f7adb08e2495
Created April 2, 2024 03:11
Fix for Copy and paste between iPhone and Mac(a.k.a Universal clipboard) not working
```
$ defaults delete ~/Library/Preferences/com.apple.coreservices.useractivityd.plist ClipboardSharingEnabled
$ defaults write ~/Library/Preferences/com.apple.coreservices.useractivityd.plist ClipboardSharingEnabled 1
```
[Copy and paste from iPhone to MacOS not w… \- Apple Community](https://discussions.apple.com/thread/254811288?answerId=259970423022&sortBy=best#259970423022)
@harupong
harupong / gist:f8b30da847745bda21c0f16564cfe858
Created January 19, 2024 00:49
Adding new user and enable sudo on Debian based systems. I can never remember whether it is `adduser` or `useradd`
userid=<username>
adduser ${userid}
usermod -aG sudo ${userid}
@harupong
harupong / テストだよ.md
Created May 6, 2023 22:35
テストです

‎‎​

‎‎​

@harupong
harupong / gist:46fb8b4d8dd5825d7aa653a719087d1f
Created September 11, 2018 09:30
Quick and dirty PowerShell script to dedupe Google photos using rclone
$paths = @(
"google-drive:Google Photos\path1",
"google-drive:Google Photos\path2",
"google-drive:Google Photos\path3",
)
$paths | ForEach-Object -Process {
echo $_ ; .\rclone lsf $_ | Measure-Object –Line ; if($?) {.\rclone dedupe --dedupe-mode largest $_}
}
@harupong
harupong / five_minutes.yml
Created February 26, 2016 03:32 — forked from ryane/five_minutes.yml
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@harupong
harupong / gist:2340e3d6fd380fc4d3a5
Last active January 5, 2016 05:17
crude one-liner to dowload latest GitBucket war file from GitHub
wget https://github.com/gitbucket/gitbucket/releases/download/$(curl -s https://api.github.com/repos/gitbucket/gitbucket/releases/latest | grep -Po '(?<="tag_name": ")[^"]*')/gitbucket.war -O gitbucket.war
@harupong
harupong / ansible_ripdiko.md
Last active August 29, 2015 13:59
Ansible で遊ぼう

TODO

linode-cli 用の apt-repo 追加で失敗する

2014-04-13 17:30 くらいの ansible.log を確認してみよう

ansible-playbook の GATHERING FACTS で SSH エラーが出た場合の検知と対応方法を探す

2014-04-13 00:31:21,448 p=2608 u=ubuntu |  PLAY [all] ********************************************************************
@harupong
harupong / error.log
Created February 10, 2014 06:20
progit/makepdfs ja error log
$ /bin/bash makepdfs ja
Will generate pdf for the following languages:
ja
The generation process will start now.
ja:
Parsing markdown... done
Creating main.tex for ja... Exception `Errno::EEXIST' at /usr/lib/ruby/1 .9.1/fileutils.rb:247 - File exists - /home/vagrant/projects/progit-ja/latex/ja
done
Running XeTeX:
@harupong
harupong / box_file_sender.rb
Last active August 29, 2015 13:56
Linux サーバー上で1日1つ生成されるファイルを Box に自動アップロードする
# coding: utf-8
# based on http://pgnote.net/?p=1842
require 'mail'
attachment = ARGV.shift
Mail.defaults do
delivery_method :smtp, {
:address => "<Server-Address>",