Skip to content

Instantly share code, notes, and snippets.

@arivero
arivero / disable.sh
Created June 25, 2023 18:36 — forked from mtunjic/disable.sh
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@arivero
arivero / bledump.txt
Created January 24, 2022 18:52 — forked from andypiper/bledump.txt
experimenting with BLE and LEGO Boost
LEGO Move Hub
8E552B7A-1B9E-4F4D-A0AE-7D585F784B73
advertisementData: ["kCBAdvDataIsConnectable": 1, "kCBAdvDataTxPowerLevel": 0, "kCBAdvDataLocalName": LEGO Move Hub]
00001623-1212-EFDE-1623-785FEABCD123 []
00001624-1212-EFDE-1623-785FEABCD123 ["read", "writeWithoutResponse", "write", "notify"] <0f00043c 01140002 00000002 000000> ["Client Characteristic Configuration <0100>"]
Notification Log:
1502201043.29111 - 00001624-1212-EFDE-1623-785FEABCD123 isNotifying: true
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@arivero
arivero / lmdb.tcl
Created February 4, 2020 19:56 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
$ apt-get update && apt-get upgrade --assume-yes
$
$ pip3 install frida-tools
$ pip3 install objection
$
$ sudo apt-get install android-tools-adb android-tools-fastboot
$
$ wget wget https://github.com/frida/frida/releases/download/12.7.0/frida-server-12.7.0-android-arm64.xz
$ unxz frida-server-12.7.0-android-arm64.xz
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@arivero
arivero / .bashrc
Created February 1, 2019 16:36 — forked from mGalarnyk/.bashrc
Function to append to the end of .bashrc file in linux to run PySpark on jupyter notebook for the blog post https://medium.com/@GalarnykMichael/install-spark-on-ubuntu-pyspark-231c45677de0#.qxguj5czj
function snotebook ()
{
#Spark path (based on your computer)
SPARK_PATH=~/spark-2.0.0-bin-hadoop2.7
export PYSPARK_DRIVER_PYTHON="jupyter"
export PYSPARK_DRIVER_PYTHON_OPTS="notebook"
# For python 3 users, you have to add the line below or you will get an error
#export PYSPARK_PYTHON=python3
import numpy as np
from sklearn.datasets import make_moons
from sklearn.cross_validation import train_test_split
n_feature = 2
n_class = 2
def make_network(n_hidden=100):
@arivero
arivero / embeddings_and_convs.py
Created February 23, 2018 15:23 — forked from pekaalto/embeddings_and_convs.py
Example of two equivalent methods of embedding categorical features on channel dimension
"""
Pekka Aalto 2017
This snippet tries to explain by example what deepmind means
in https://arxiv.org/abs/1708.04782
about embedding on channel axis being equivalent to
one-hot-encoding followed by 1x1 conv.
They write: