Skip to content

Instantly share code, notes, and snippets.

@Nosskirneh
Nosskirneh / README.md
Last active July 1, 2020 00:47 — forked from kirb/.htaccess
Self-hosted Cydia Repo Download Counter

How to Add a Download Counter to A Self-Hosted Cydia Repo

This is a fork of kirb's repo download counter, only that this one works and that one doesn't.

Installation

  1. Click the download link at the top of the gist page to save these files to your machine.
  2. Unzip them and open counter.php and nginx.conf in your favorite non-Notepad text editor.
  3. In counter.php, scroll down to the line that says $db = mysqli_connect( ... and change the parameters to the ones you use to connect to MySQL.
  4. If your database doesn't use the UTF-8 charset, change the UTF8 in the if (!mysqli_set_charset($db, "UTF8")) ... line to the appropriate value.
  5. Go down to the if (!mysqli_select_db($db, "myrepodb")) ... line and change myrepodb to the name of your database.
  6. Run the downloads.sql file i
@Nosskirneh
Nosskirneh / networkchange.plist
Created July 27, 2017 07:18
Automatically update theos device settings and kill/open Dropbox on network change (macOS)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>networkchange</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
@Nosskirneh
Nosskirneh / README.md
Created February 13, 2020 15:02
Logging without syslog – Tweak development

The iOS syslog was removed in iOS 13.3. Prior to that, you could still view the deprecated syslog if you compiled your tweaks using an iOS 9 or lower SDK. Apple introduced oslog in iOS 10.

  1. Clone https://github.com/theos/theos/ to $THEOS/sdks.
  2. Change $THEOS/vendor/logos/bin/lib/Logos/Generator/Base/Method.pm:73 from HBLogDebug(... or NSLog(..., depending on theos version, to log(... .
  3. Add the following to $THEOS/include/HBLog.h:
    • #define log(...) HBLogWarn(@"<NOSS>: %@", [NSString stringWithFormat:__VA_ARGS__]); on line 19, ie if you're running os_log / iOS 10+ SDK.

    • #define log(...) HBLogDebug(__VA_ARGS__); on line 41, ie when not running an iOS 10+ SDK.

  4. On your iDevice, add alias debug="oslog | awk 'f; /\)/{f=0} /:/{print; f=/\(/}'" to /etc/profile.d/profile.sh and source it afterwards. You may need to create the file if you haven't already.