Skip to content

Instantly share code, notes, and snippets.

@ffeldhaus
ffeldhaus / ds215j_bootstrap_ng.md
Last active Apr 8, 2020
Bootstrap Synology ds215j using optware-ng
View ds215j_bootstrap_ng.md

Bootstrap the Synology DS215j with optware-ng

I tried the instructions described in the Blogpost Bootstrap DS215j to install optware for ds215j but was unsatisfied with the long outdated packages it provided. Luckily, there now is optware-ng which is a fork of optware and provides recent packages.

This is how I managed to install optware-ng on my Synology ds215j inspired by the instructions in the Gist Boostrap the Synology DS215j with optware, ipkg, and sudo:

Download & Install ipkg in a persistent manner

# become root
sudo -i
@599316527
599316527 / ddns-start
Last active Oct 18, 2019
asuswrt-merlin custom ddns script for dnspod
View ddns-start
#!/bin/sh
# This file should be placed in /jffs/scripts/ folder.
# 后台申请token
# https://support.dnspod.cn/Kb/showarticle/tsid/227/
login_token='xxxxxxx,yyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
# 先调 Domain.List 和 Record.List 接口取得 id
# https://www.dnspod.cn/docs/domains.html#domain-list
# https://www.dnspod.cn/docs/records.html#record-list
@randomsequence
randomsequence / cocoa-drawing.swift
Created Jul 14, 2015
Drawing images with CGContext and NSGraphicsContext in Swift
View cocoa-drawing.swift
//: Playground - noun: a place where people can play
import Cocoa
let bounds = CGRectMake(0, 0, 100, 100);
func DrawImageInCGContext(#size: CGSize, #drawFunc: (context: CGContextRef) -> ()) -> NSImage {
let colorSpace = CGColorSpaceCreateDeviceRGB()
let bitmapInfo = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue)
let context = CGBitmapContextCreate(
@c9iim
c9iim / AXUIElement_in_Swift.swift
Last active Dec 23, 2020
AXUIElement in Swift
View AXUIElement_in_Swift.swift
import Cocoa
protocol AXUIProtocol {
func AXUIWindowArray(processIdentifier pid:pid_t) -> [AXUIElement]
func AXUIWindowArray(bundleIdentifier bid:NSString) -> [AXUIElement]
}
extension AXUIProtocol {
func AXUIWindowArray(processIdentifier pid:pid_t) -> [AXUIElement] {
let windowList : UnsafeMutablePointer<AnyObject?> = UnsafeMutablePointer<AnyObject?>.alloc(1)
@ku
ku / metatag.m
Created Nov 12, 2013
OSX10.9 tag manipulation util
View metatag.m
#import <Foundation/Foundation.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// clang tag.m -o metatag -framework "foundation" -fobjc-arc && ./metatag
int main(int argc, char **argv) {
char *tagToAdd = NULL;
@sekati
sekati / xcode-build-bump.sh
Created Jul 24, 2012
Xcode Auto-increment Build & Version Numbers
View xcode-build-bump.sh
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@fionawhim
fionawhim / unlock.scpt
Created May 31, 2012
Unlock screensaver via AppleScript in Lion
View unlock.scpt
tell application "System Events"
if name of every process contains "ScreenSaverEngine" then
tell application "ScreenSaverEngine"
quit
end tell
keystroke <YOUR PASSWORD HERE>
keystroke return
end if
end tell
@kylefox
kylefox / color.m
Created Jan 27, 2012
Generate a random color (UIColor) in Objective-C
View color.m
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
You can’t perform that action at this time.