Skip to content

Instantly share code, notes, and snippets.

Janne Lehikoinen jlehikoinen

Block or report user

Report or block jlehikoinen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jlehikoinen
jlehikoinen / create_xcode_icns.sh
Created Aug 29, 2019
Create Xcode iconset for macOS app from a 1024x1024 sized png file
View create_xcode_icns.sh
#!/bin/sh
# ================================================
# create_xcode_icns.sh
#
# Create Xcode iconset for macOS app from a 1024x1024 sized png file
#
# Drag png file to Terminal window to get the file path as a parameter for the script
# Iconset will be created to the same folder where the original icon is
# Import (drag&drop) icns file to Xcode
@jlehikoinen
jlehikoinen / gist:28ec2336f82110829868931543b4ed95
Last active Jan 24, 2019
Remove signature from Configuration Profile using Quick Action
View gist:28ec2336f82110829868931543b4ed95
# Automator > Quick Action
# Workflow receives current "files or folders" in "Finder"
# Add "Run Shell Script" action
# Copy script below to "Run Shell Script" window
# Replace <text-editor-app> at row 34 with your preferred text editor app
# Save quick action as: "Remove signature from Profile & open in <app>"
# Quick Actions live in: ~/Library/Services
# Target folder
@jlehikoinen
jlehikoinen / set_outlook_as_default_application.py
Last active Aug 17, 2017
Set MS Outlook as default email application in macOS
View set_outlook_as_default_application.py
#!/usr/bin/python
"""
set_outlook_as_default_application.py
Description:
Set Outlook as a default application for email, calendar and contacts
"""
@jlehikoinen
jlehikoinen / set_default_application_for_filetype.py
Last active Jun 30, 2017
Set default application for a file type in macOS
View set_default_application_for_filetype.py
#!/usr/bin/python
"""
set_default_application_for_filetype.py
Description:
Set default application for a file type in macOS
"""
@jlehikoinen
jlehikoinen / clean_up_infected_handbrake.sh
Last active May 9, 2017
Clean up infected HandBrake (1.0.7) for macOS
View clean_up_infected_handbrake.sh
#!/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 / remove_admin_rights.py
Last active May 6, 2017
Remove admin rights in macOS
View remove_admin_rights.py
#!/usr/bin/python
"""
# Beef:
/usr/bin/dscl -plist . -read /Groups/admin GroupMembership
/usr/sbin/dseditgroup -o edit -d <shortname> -t user admin
"""
"""
@jlehikoinen
jlehikoinen / setup.sh
Last active Aug 29, 2019
Swift syntax highlighting for Vim
View setup.sh
# Swift syntax highlighting for Vim
# Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
echo "--- Installing and configuring Pathogen.."
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo "execute pathogen#infect()
syntax on
View setup_example.py
"""
setup_example.py
Run this script from the Pythonista Documents root
Setup script for https://github.com/jlehikoinen/pythonista-flask-example
"""
import requests
import zipfile
import urllib
import tempfile
@jlehikoinen
jlehikoinen / install_flask_pkgs.py
Created Feb 13, 2016
Install Flask packages for Pythonista demo
View install_flask_pkgs.py
# 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 / com.yourdomain.restart-caching-server.plist
Last active Oct 14, 2015
LaunchDaemon for restarting Caching Server running over Wi-Fi
View com.yourdomain.restart-caching-server.plist
<?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>
You can’t perform that action at this time.