Skip to content

Instantly share code, notes, and snippets.

@marcoarment
marcoarment / apns_jwt_token.php
Last active April 14, 2024 06:49
Generate ES256 JWT tokens for Apple Push Notification Service (APNS) in PHP
<?php
function base64url_encode($binary_data) { return strtr(rtrim(base64_encode($binary_data), '='), '+/', '-_'); }
function apns_jwt_token($team_id, $key_id, $private_key_pem_str)
{
if (! function_exists('openssl_get_md_methods') || ! in_array('sha256', openssl_get_md_methods())) throw new Exception('Requires openssl with sha256 support');
$private_key = openssl_pkey_get_private($private_key_pem_str);
if (! $private_key) throw new Exception('Cannot decode private key');
@davecoutts
davecoutts / make_netatalk-3.1.11_deb.sh
Created May 6, 2018 21:51
Install Netatalk 3.1.11 on Ubuntu 18.04 Bionic
# This gist gives instructions to build a basic deb package of netatalk-3.1.11 using checkinstall on Ubuntu 18.04.
# With the idea being that you build the deb on your build server and install from the resulting deb in production.
# Given that the deb is packaged using checkinstall with basic options, think home use, not real production.
# Note that this build does not provide the spotlight feature.
# The tracker packages have been left out as the intent was to provide TimeMachine functionality only.
#------------------------------------------------------------
# STEP ONE - Make the Netatalk deb on a build machine
@6david9
6david9 / parse_ipa.py
Created March 25, 2015 07:12
parse ipa
# -*- coding: UTF-8 -*-
import zipfile
import biplist
import tempfile
import shutil
import re
import os
@lvzongting
lvzongting / Mac os 打印驱动 for linux
Created October 27, 2014 03:28
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。
Mac os 打印驱动 for linux
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。这里只是记录了一个方法,为了方便大家使用,我正在寻找一个网络空间可以将我提取出来的这些ppd驱动文件上传上去提供大家下载,可能还会提供一个便于检索的网页,如果大家有需要什么打印驱动的话,可以在这个gist后面留言。
当然,我也会积极的将这些文件进行打包,然后丢到各大软件源中。以方便大家的使用。
真心希望,linux这样好用的系统能快速发展,普及,能让更多的人感受到使用linux的快乐。
苹果系统 Mac OS 打印驱动用在linux系统。(通过cups 通用Unix打印系统ppd格式化文件驱动打印机)
@balupton
balupton / README.md
Last active June 29, 2023 07:04
Installing ChromiumOS

Install ChromiumOS

  1. Get Chromium OS from one of the following places
    1. Download the vanilla build (old but stable): http://chromeos.hexxeh.net/
      1. NOTE: Password is facepunch
    2. Download the nightly build (sync doesn't work): http://download-chromiumos.appspot.com/
      1. NOTE: If you want developer mode, you must change _base_ in the download URL to _test_ as the base image does not have developer tools enabled
      2. NOTE: Password is unknown, instructions for working around this are provided later
      3. NOTE: I could not get syncing working with this build, perhaps due to no API KEYS being provided???
  2. NOTE: I could not move past the welcome screen on the 64bit build due to no network being found (32bit worked)