Skip to content

Instantly share code, notes, and snippets.

# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
@thefrosty
thefrosty / freemius.php
Created January 12, 2024 17:39
Create an override function, as to bypass Freemius in some less than smart plugins.
<?php
declare(strict_types=1);
/**
* Create an override function, as to bypass Freemius in stupid plugins.
* @wordpress-muplugin
* Plugin Name: Freemius Killer
* Description: Global override for Freemius' "loader".
* Version: 1.0.0
@GlenCrawford
GlenCrawford / schema_dumper.rb
Created April 17, 2020 13:59
Patching Rails database schema dumps to support multiple PostgreSQL schemas.
# Overrides Rails file activerecord/lib/active_record/schema_dumper.rb to
# include all schema information in the db/schema.rb file, for example, in the
# create_table statements. This allows for a working development database
# to be built from a schema.rb file generated by rake db:schema:dump.
#
# This is essentially a rebuild of the "schema_plus_multischema" gem (which is
# unfortunately only compatible with Rails ~> 4.2).
#
# Tested with Rails 6.0.
@m45k174
m45k174 / lamp.sh
Last active May 17, 2024 19:49 — forked from aamnah/lamp.sh
Bash script to install Apache, MySQL and PHP as well as PHPMyAdmin and some tweaks. For Debian and Ubuntu. To run, copy the script to the server and run ``bash lamp.sh``
#!/bin/sh
#######################################
# Bash script to install an AMP stack and PHPMyAdmin plus tweaks. For Debian based systems.
# Written by @AamnahAkram from http://aamnah.com
# In case of any errors (e.g. MySQL) just re-run the script. Nothing will be re-installed except for the packages with errors.
#######################################
#COLORS
@aglab2
aglab2 / a.md
Last active May 17, 2024 19:44
Project 64 1.6 container escape vulnerability writeup

Vulnerable emulator is Project 64 1.6.x/1.7. 2 vulnerabilities can be used to gain arbitrary code execution from emulation container from N64 ROM.

  1. Container escape and arbitrary writes from N64 ROM outside of designated N64 RAM

Vulnerable function Compile_R4300i_SB and its friends Compile_R4300i_S* https://github.com/zeromus/pj64/blob/master/RecompilerOps.cpp#L1955C6-L2024

If non const Opcode.base is used to avoid condition at 1961-1971 which does checks properly, we can load from volatile address addr (compiled to MIPS asm inside ROM):

Developer hints

To debug properly this plugin using xdebug make sure to install adequate version for your PHP version.

Official moodle docker setup

Install and configure xdebug 3.x

moodle-docker-compose exec webserver pecl install xdebug-<version 3.x>
@2ik
2ik / cmd.bat
Last active May 17, 2024 19:41
Устранение ошибки в терминале VScode при запуске virtualenv
Ошибка:
.\venv\Scripts\activate : Невозможно загрузить файл C:\path\venv\Scripts\activate.ps1, так как выполнение сценариев отключено в этой системе.
Для получения дополнительных сведений см. about_Execution_Policies по адресу http://go.microsoft.com/fwlink/?LinkID=135170.
строка:1 знак:1
.\venv\Scripts\activate
~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : Ошибка безопасности: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess
Решение проблемы:
@hasezoey
hasezoey / koreader_on_tolino.md
Last active May 17, 2024 19:41
Install KOReader on a Tolino device (Vision 5)

Install KOReader on a Tolino Device

Tolino Debug Menu codes

For KOReader (or any other APK) to be installed on a Tolino device, the debug menu has to be enabled:

  • if the tolino is on system version 14, search for code 124816 source
  • if the tolino is on system version 15, search for code 1123581321 source
  • if the tolino is on system version 16, search for code 112358132fb source

Note: "searching" as in the search for books on the tolino itself (the magnifying glass in the top bar)

@khalidx
khalidx / co-founder-matching.md
Created May 17, 2024 19:30
A template to use when meeting with a potential co-founder.

This is a general guideline for your first meeting with a potential co-founder.

Just replace any {variable} with information about you, your guest, or your startup.

Co-Founder Matching Template

Intro Call

Co-Founder Matching Call with {Guest} on {Date}