Skip to content

Instantly share code, notes, and snippets.

View messense's full-sized avatar
🐢
I may be slow to respond on workdays.

messense messense

🐢
I may be slow to respond on workdays.
View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active May 11, 2024 13:54
Quantopian Lectures Saved
@rlam3
rlam3 / disable-cleanmymac.md
Created August 21, 2019 01:26
Mac disables "Setapp CleanMyMac-setapp.HealthMonitor" launchd services

sudo vim /private/var/db/launchd.db/com.apple.launchd/overrides.plist

Add the following code,as entries like:

<key>com.macpaw.CleanMyMac-setapp.HealthMonitor</key>
<dict>
<key>Disabled</key>
<true/>
@LukasKalbertodt
LukasKalbertodt / 0-rust-wasm-llvm-backend.md
Last active September 22, 2020 12:18
Several Rust & WebAssembly notes

Compiling Rust to Wasm manually with the LLVM wasm-backend (without Emscripten)

EDIT November 2017: recently the target wasm32-unknown-unknown was added to rustc which uses the LLVM WASM backend and works without Emscripten. This is now the recommended way of generating WASM code from Rust (as it is much easier). Thus, this gist document is pretty much useless now. A great resource on getting started with WASM and Rust is hellorust.com: Setup and Minimal Example.




@mgeeky
mgeeky / python_memory_dump.py
Created June 27, 2017 22:18
Example of dumping memory from within Python's code, using `ctypes.c_byte.from_address`
#!/usr/bin/python
def hex_dump_memory(ptr, num):
import ctypes
s = ''
n = 0
lines = []
data = list((num * ctypes.c_byte).from_address(ptr))
@jakub300
jakub300 / run.sh
Last active January 9, 2022 01:48
Compile headless shell (Chromium)
# Based on:
# https://web.archive.org/web/20200212121848/http://www.zackarychapple.guru/chrome/2016/08/24/chrome-headless.html
# https://www.chromium.org/developers/how-tos/get-the-code
# https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
apt-get update
apt-get install -y curl git htop man unzip vim wget python
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:`pwd`/depot_tools
mkdir Chromium && cd Chromium
@abn
abn / rpm-build-workflow.md
Last active May 18, 2022 05:04
RPM build and hosting workflow using github, travis-ci and copr

RPM Build Flow

This document details a simple RPM build flow pattern used to build and host RPM artifacts for open source projects. The below is a visual summary of this flow.

In order to achieve this multiple tools and services are used. The services and their purpose in the flow is as listed below.

Service Purpose
GitHub As is the most common use for GitHub, it holds the build source code. In this case we hold only the spec files and related source files. All other sources, including project binaries/sources are retrieved at build time.
@uffsalot
uffsalot / collectd.conf
Created July 16, 2016 12:23
sample collectd.conf
FQDNLookup true
Interval 120
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin disk
@erikbern
erikbern / use_pfx_with_requests.py
Last active May 1, 2024 11:45
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@simonrw
simonrw / python_pymysql_notes.md
Created September 18, 2015 19:01
Notes about pymysql connections

Database transactions

pymysql

  • Defaults to autocommit=False
connection = pymysql.connect(user='user', db='test')
cursor = connection.cursor()
cursor.execute('insert into test (value) values (10)')