Skip to content

Instantly share code, notes, and snippets.

View jlehikoinen's full-sized avatar
🍏
Digesting WWDC23

Janne Lehikoinen jlehikoinen

🍏
Digesting WWDC23
View GitHub Profile
@jlehikoinen
jlehikoinen / pairs.swift
Created February 27, 2015 05:14
Swift exercise - Pairs
#!/usr/bin/env xcrun swift
// pairs.swift
//
// Created by Lehikoinen Janne on 06/10/14.
// Copyright (c) 2014 FMC. All rights reserved.
//
// Note! This script runs for 5+ minutes!
@jlehikoinen
jlehikoinen / auto-git-push.sh
Created February 27, 2015 05:16
Automating git push
#!/bin/sh
# Copyright (c) 2014 Janne Lehikoinen
#
# auto-git-push.sh
# Push local git repo to remote origin master branch
###
@jlehikoinen
jlehikoinen / gist:4a2054774e8d6edcf121
Created March 16, 2015 07:29
MSLync AutoPkg recipe verbose output
Processing MSLync.munki...
MSLyncURLandUpdateInfoProvider
MSLyncURLandUpdateInfoProvider: Found URL http://download.microsoft.com/download/5/0/0/500C7E1F-3235-47D4-BC11-95A71A1BA3ED/lync_14.0.10_141024.dmg
MSLyncURLandUpdateInfoProvider: Got update: 'Lync 14.0.10 Update'
MSLyncURLandUpdateInfoProvider: Additional pkginfo: {'minimum_os_version': '10.5.8', 'display_name': 'Lync 14.0.10 Update', 'description': '<html><p>This update fixes critical issues. </p>\n\n<p>For detailed information about this update, please visit the following Web site: </p>\n\n<p><a href="http://go.microsoft.com/fwlink/?LinkId=328458" target="_blank">http://go.microsoft.com/fwlink/?LinkId=328458</a></p>\n\n<p>For additional assistance, or to obtain a downloadable version of this update, visit the <a href="http://go.microsoft.com/fwlink/?LinkId=309173" target="_blank">Microsoft Web site</a>.</p></html>', 'name': u'MSLync'}
URLDownloader
Couldn't download http://download.microsoft.com/download/5/0/0/500C7E1F-3235-47D4-BC11-95A71A1BA3ED/ly
@jlehikoinen
jlehikoinen / gist:5a036ce8c7c20be98402
Created May 25, 2015 08:13
Gmail mobileconfig payload
<dict>
<key>PayloadType</key>
<string>com.apple.mail.managed</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.apple.mdm.server.local.9aff7590-29cf-0132-aec7-1234569012.alacarte.email.1a2b3c4d-29d0-0132-aec9-000c292f</string>
<key>PayloadUUID</key>
<string>5b041780-29d0-0135-aec9-000c432567</string>
<key>PayloadEnabled</key>
@jlehikoinen
jlehikoinen / com.yourdomain.restart-caching-server.plist
Last active October 14, 2015 18:43
LaunchDaemon for restarting Caching Server running over Wi-Fi
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yourdomain.restart-caching-server</string>
<key>ProgramArguments</key>
<array>
<string>bash</string>
<string>-c</string>
@jlehikoinen
jlehikoinen / install_flask_pkgs.py
Created February 13, 2016 18:01
Install Flask packages for Pythonista demo
# Requires: https://gist.githubusercontent.com/anonymous/5243199/raw/378974dc4155c07a797dd1d8f45e2a599707e133/Pypi.py
from Pypi import Installer
Installer('Flask', '0.10.1').install()
Installer('Werkzeug', '0.11.3').install()
Installer('Jinja2', '2.8').install()
@jlehikoinen
jlehikoinen / remove_admin_rights.py
Last active May 6, 2017 05:59
Remove admin rights in macOS
#!/usr/bin/python
"""
# Beef:
/usr/bin/dscl -plist . -read /Groups/admin GroupMembership
/usr/sbin/dseditgroup -o edit -d <shortname> -t user admin
"""
"""
@jlehikoinen
jlehikoinen / clean_up_infected_handbrake.sh
Last active May 9, 2017 00:08
Clean up infected HandBrake (1.0.7) for macOS
#!/bin/sh
###
# Clean up infected HandBrake (1.0.7) for macOS
# Note that this script is WIP and does not remove all the traces of the malware
# e.g. reverting /etc/sudoers back to previous state is left out here
# Based on the information posted here:
@jlehikoinen
jlehikoinen / set_default_application_for_filetype.py
Last active June 30, 2017 03:56
Set default application for a file type in macOS
#!/usr/bin/python
"""
set_default_application_for_filetype.py
Description:
Set default application for a file type in macOS
"""
@jlehikoinen
jlehikoinen / set_outlook_as_default_application.py
Last active August 17, 2017 06:43
Set MS Outlook as default email application in macOS
#!/usr/bin/python
"""
set_outlook_as_default_application.py
Description:
Set Outlook as a default application for email, calendar and contacts
"""