Skip to content

Instantly share code, notes, and snippets.

@j796160836
j796160836 / copyToProject.py
Created January 30, 2018 09:12
Copy illustrator CC output images to your Android project.
#!/usr/bin/env python
# encoding: utf-8
# ## copyToProject.py
# Copy illustrator CC output images to your Android project.
# ### How to use:
# 1. Put this script at the illustrator CC output folder
# 2. Edit `projectPath` and `targetPrefix` for your want
# For example, we have these files:
@j796160836
j796160836 / update-jenkins.sh
Last active February 10, 2019 21:37 — forked from lacek/update-jenkins.sh
Update Jenkins on Mac OS X
#!/bin/bash
DEFAULT_URL=http://updates.jenkins-ci.org/current/latest/jenkins.war
TMP_PATH=/tmp/jenkins.war
APP_PATH=/Applications/Jenkins/jenkins.war
PLIST_PATH=/Library/LaunchDaemons/org.jenkins-ci.plist
url=${1-$DEFAULT_URL}
echo 'Downloading WAR package...'
@j796160836
j796160836 / namecheap_ddns.py
Last active July 22, 2022 22:32
Python scripts for update DNS record for Namecheap (DDNS Services update script)
#!/usr/bin/env python
# encoding: utf-8
# Setup introductions:
# Open Namecheap website, select a domain (e.g. abc.com) then go to Advanced DNS
# (Accounts > Domain List > Advanced DNS)
# Insert an "A + Dynamic DNS Record", with hostname (e.g. my) and type whatnever IP address.
# Edit scripts for proper HOSTNAME (e.g. my.abc.com) and APIKEY (Dynamic DNS Password).
# Run and have fun!
@j796160836
j796160836 / namecheap-synology-ddns.php
Last active November 12, 2023 10:49
Add custom DDNS provider for Namecheap on Synology NAS
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
/*
Usage Instructions ( Obviously your domain has to be hosted on Namecheap )
1) Copy this file to /usr/syno/bin/ddns/namecheap.php
2) Add the following entry in /etc.defaults/ddns_provider.conf
[Custom - Namecheap]
modulepath=/usr/syno/bin/ddns/namecheap.php
@j796160836
j796160836 / dummy-web-server.py
Created September 26, 2017 12:56 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@j796160836
j796160836 / LinuxMotd.md
Last active October 27, 2018 12:50
Linux 開機歡迎顯示系統資訊

Linux 開機歡迎顯示系統資訊

操作系統: Ubuntu
不同 distributions 指令會有些微差異

  • 安裝 landscape-common 套件
$ sudo apt-get install landscape-common
@j796160836
j796160836 / getudid.sh
Created December 17, 2016 13:36 — forked from tehnoir/getudid.sh
getudid
#!/bin/bash
function getUDID {
udid=($(system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad" | grep "Serial Number" | awk '{ print $3 }'))
if [ -z $udid ]; then
echo "No device detected. Please ensure an iOS device is plugged in."
exit 1
else
for i in "${udid[@]}"; do
echo -n $i | pbcopy
@j796160836
j796160836 / set_project_profiles.sh
Created December 17, 2016 13:35 — forked from tehnoir/set_project_profiles.sh
Update Xcode project's build settings to point to current provisioning profiles.
#!/bin/bash
##############################################################################################################
### 1. Name your profiles with the convention of ProjectName_TargetName_ConfigurationName.mobileprovision ###
### 2. Create a directory called CodeSign in your project directory ###
### 3. Move all your project's provisioning profiles into the CodeSign directory ###
### ###
### Running this script will update your project file to point to the correct UUIDs of each corresponding ###
### profile in your CodeSign directory. ###
##############################################################################################################
#!/bin/bash
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
{
"location": "Toronto, Canada",
"three_day_forecast": [
{
"conditions": "Partly cloudy",
"day" : "Monday",
"temperature": 20
},
{
"conditions": "Showers",