Skip to content

Instantly share code, notes, and snippets.

View MacsInSpace's full-sized avatar

Craig Hair MacsInSpace

  • Department of Education
  • Melbourne
  • 20:10 (UTC +10:00)
View GitHub Profile
@kaloprominat
kaloprominat / macos: manage add list remove login items apple script
Last active April 11, 2025 22:26
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
@meleyal
meleyal / osx.sh
Last active May 18, 2023 19:40
OSX defaults, based on http://mths.be/osx
##
# OSX defaults, based on http://mths.be/osx
#
# Ask for the administrator password upfront
sudo -v
# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "air"
sudo scutil --set HostName "air"
@Raefael
Raefael / deleting_merging_partitions
Created June 12, 2013 07:34
Deleting and merging a partition with diskutil from the command line OS X
/**
* diskutil list shows you the partitions currently connected to your unit
**/
imac:~ user$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 987.2 GB disk0s2
@yanofsky
yanofsky / LICENSE
Last active March 14, 2025 18:19
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@altrive
altrive / Install-SysInternalsTool.ps1
Last active September 5, 2024 02:48
Install and setup script for SysInternals tools(BGInfo/AutoLogon).
#Install SysInternals BGInfo/AutoLogon tools
function Install-SysInternalsTool
{
#Target directory is %WinDir%C:\Windows\System32\SysInternals
$targetDir = Join-Path $env:WinDir "System32\SysInternals"
#Tools to be downloaded
$tools = @{
Bginfo = "http://live.sysinternals.com/Bginfo.exe"
Autologon = "http://live.sysinternals.com/Autologon.exe"
@sourcec0de
sourcec0de / PrivateTorrent.md
Last active September 1, 2022 09:04
Host a private torrent tracker, and seed a torrent on ubuntu 12.10

Install dep, and start tracker

sudo apt-get install bittornado ctorrent
bttrack --port 6969 --dfile ~/.bttrack/dstate --logfile ~/.bttrack/tracker.log --nat_check 0 --scrape_allowed full

Now, create a torrent file

ctorrent -t -u "YOUR_SERVER_IP:6969/announce" -s new_file_name.torrent file_or_folder_for_torrent
@jedda
jedda / gist:4103604
Created November 18, 2012 04:44
Configuring basic RADIUS on OS X 10.8 Server
# Configuring basic RADIUS on OS X 10.8 Server
# Jedda Wignall
# http://jedda.me
# Full writeup at: http://jedda.me/2012/11/configuring-basic-radius-os-108-server/
# create the SACL for access to RADIUS
dseditgroup -q -o create -u <admin user> -n . com.apple.access_radius
# configure radiusd to log both successful and failed authentications
@varnav
varnav / adusers_weblist.php
Last active January 7, 2024 10:24
Web table listing active directory users
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Список сотрудников</title>
<style>
a {text-decoration : none}
a:link {color : #000000}
<?php
require_once('libs/curl/curl.php'); // https://github.com/shuber/curl
class Youtube extends Curl
{
public $params = array(
'key' => 'AIzaSyD2g6U5OzaLLvzEBBacZBhfaBIKeoZnKFM', // API Key
'maxResults' => 50, // Max items in result set
'part' => 'snippet' // https://developers.google.com/youtube/v3/getting-started#part
@robinsloan
robinsloan / langoliers.rb
Last active February 27, 2025 02:44
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"