- Get the currently connected computers:
arp -i en1 -a
andarp -i bridge100 -a
- Filter connections by MAC address: http://michaelleo.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/
- Grab the list of DHCP leases from
/private/var/db/dhcpd_leases
(this won't necessarily tell you who is connected, but it's good for knowing who has connected) Enable Internet Sharing withsudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist
(and useunload
to disable)- Messing with the Internet Sharing settings directly is giving me inconsistent results. For my particular case, it's easiest to just set up my Sharing settings manually and then turn the WiFi on and off based on my needs with
networksetup -setairportpower en1 on
ornetworksetup -setairportpower en1 off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Builds mpv & mpv.app on Apple silicon Macs. | |
# Run this script from the root directory of the mpv repo. | |
# if anything fails, gtfo | |
set -ex | |
meson setup build | |
meson compile -C build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如果你连挣钱都要别人开导你,要盯着,看着,哄着,鼓励着,劝你还是别干了,你就应该穷。 | |
古之成大事者,不惟有超世之才,亦必有艰苦不拔之志 | |
不用去追一匹马,用追马的时间种草,待春暖花开,会有骏马任你挑选。 | |
坚定目标,持续前进,承受痛苦 | |
如果周围没有优秀的人,那就让自己成为最优秀的人 | |
唯有自律可以自救,自律是捍卫时间与自由的唯一手段,自律能带来精神上的免疫,对无用信息免疫 | |
明确你的目标,不要用战术上的勤奋掩盖战略上的懒惰 | |
天助自助者 | |
你的努力,决定孩子坐在哪里!你的努力,决定父母晚年的生活! | |
世界上最幸福的事之一,莫过于经过一番努力后,所有东西正慢慢变成你想要的样子。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- hs.logger.setGlobalLogLevel('debug') | |
local logger = hs.logger.new('focus') | |
hs.timer.doEvery(3, function() | |
local current = hs.mouse.getCurrentScreen() | |
-- hs.rawprint(current) | |
if current and current ~= hs.screen.mainScreen() then | |
local windows = hs.window.orderedWindows() | |
for _, l in ipairs(windows) do | |
if l:screen() == current and l:isStandard() and l:isVisible() then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name v2ex 绝对时间 | |
// @namespace http://phpz.org/ | |
// @version 0.1.5 | |
// @description 显示 v2ex 中的绝对时间 | |
// @author Seven Yu | |
// @match *.v2ex.com/* | |
// @run-at document-end | |
// @grant none | |
// @updateURL https://gist.github.com/dofy/38c8d67405a5597f4e7e/raw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
// VARIABLE must be a variable declaration (NSString *foo) | |
// VALUE is what you are checking is not nil | |
// WHERE is an additional BOOL condition | |
#define iflet(VARIABLE, VALUE) \ | |
ifletwhere(VARIABLE, VALUE, YES) | |
#define ifletwhere(VARIABLE, VALUE, WHERE) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSBundle (MYBundle) | |
+ (instancetype)MYBundle{ | |
NSBundle *mainBundle = [NSBundle mainBundle]; | |
NSURL *bundleUrl = [mainBundle URLForResource:@"MyBundle" withExtension:@"bundle"]; | |
NSBundle *bundle = [NSBundle bundleWithURL:bundleUrl]; | |
return bundle; | |
} | |
+ (UIImage*)imageNamed:(NSString*)name{ | |
UIImage *image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Turn a piano MIDI file into a basic 3D animated piano video. | |
See the result here: | |
I am leaving it as a script because it is not tested on enough MIDI files yet. | |
Zulko 2014 | |
This script is released under a Public Domain (Creative Commons 0) licence. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name nospm | |
// @version 1.5.0 | |
// @run-at document-start | |
// @updateURL https://gist.github.com/ambar/9706385/raw/nospm.user.js | |
// @downloadURL https://gist.github.com/ambar/9706385/raw/nospm.user.js | |
// @description 移除 Bilibili、淘宝、天猫、优酷、CCTV 网址中的 spm 参数(包括地址栏和页面中的链接) | |
// @include https://*.bilibili.com/* | |
// @include https://*.taobao.com/* | |
// @include https://*.tmall.com/* |
see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
NewerOlder