Skip to content

Instantly share code, notes, and snippets.


Daigo Sakamoto superdaigo

View GitHub Profile
superdaigo / block_apps_from_launching.mobileconfig
Created Dec 3, 2020
Block mac apps from launching. Applications that unable to uninstall form mac can be blocked.
View block_apps_from_launching.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
superdaigo / org
Created Dec 4, 2019
IDEA - Setup MacOS Local Environment
View org

To use Homebrew task in the Ansible, both Homebrew and Ansible should be installed in the system. That means at least Homebrew and Ansible must be installed using shell script. Following installation and configuration will be done by Ansible, so that the shell script can be use for up-to-date the local environment.

  1. Shell script
    1. Install homebrew
    2. Install ansible using homebrew
    3. Execute ansible
      • specifying /usr/local/bin/ansible to avoid PATH configured following ansible script
View multiples_of_3.rst

Multiples of 3

If the natural number X is a multiple of 3, the summary of each digit number of X is a multiple of 3 too.


3 = 3 * 1; 3 = 3 * 1
STOP_AT=$(date -j -v "+1H" "+%H:%M")
if [ ! -z $1 ] && [[ $1 =~ ^[0-9]{1,2}:[0-9]{2}$ ]] ; then
if [ ${#1} -eq 4 ] ; then
echo "Will stop at ${STOP_AT}"
superdaigo / Shonan Beach FM.asx
Created Dec 16, 2017
Japanese Internet Radio "Shonan Beach FM"
View Shonan Beach FM.asx
<Asx Version="3.0">
<Title>Shonan Beach FM 78.9</Title>
<author>Shonan Beach FM 78.9</author>
<copyright>Shonan Beach FM 78.9</copyright>
<ref href="mms://"/>
<ref href=""/>
View ForcePasswordRequiredImmediatelyAfterScreenSaver.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Screen saver password settings</string>
superdaigo / random_password
Last active Jun 10, 2016
One Liner: Generate Random Password and Copy to Clipboard (OS X)
View random_password
$ python -c 'import random,string,sys;sys.stdout.write("".join(random.sample(string.printable[:94],16)))' | pbcopy
superdaigo /
Created Apr 22, 2016
Celery rate_limit test script
# Test celery's rate_limit
Tested version of python
$ python --version
Python 2.7.11
## Requirements
$ pip install celery==3.1.23
$ pip install SQLAlchemy==1.0.12
View init.el
;; Encoding
(setq default-file-name-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
;; Misc
(setq inhibit-startup-message t) ;; Hide Startup Cow
(setq visible-bell t) ;; Visible bell
(menu-bar-mode -1) ;; Menu bar (1: Enable, -1: Disable)
(blink-cursor-mode 0) ;; Blink Cursor (0: off, 1: blink)