Skip to content

Instantly share code, notes, and snippets.

View adrianlzt's full-sized avatar

Adrián López adrianlzt

View GitHub Profile
@adrianlzt
adrianlzt / Makefile
Created February 11, 2021 09:53
Playbook example using go module
all: build playbook
build:
cd library && go build -o helloworld helloworld_src.go && cd ..
playbook:
DEFAULT_MODULE_PATH=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:./modules/ ansible-playbook play.yaml
# vim:ft=make
@adrianlzt
adrianlzt / index.html
Last active February 1, 2021 07:36
NN cost function
<!DOCTYPE html>
<html>
<head>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
</head>
<body>
\begin{gather*} J(\Theta) = - \frac{1}{m} \sum_{i=1}^m \sum_{k=1}^K \left[y^{(i)}_k \log ((h_\Theta (x^{(i)}))_k) + (1 - y^{(i)}_k)\log (1 - (h_\Theta(x^{(i)}))_k)\right] + \frac{\lambda}{2m}\sum_{l=1}^{L-1} \sum_{i=1}^{s_l} \sum_{j=1}^{s_{l+1}} ( \Theta_{j,i}^{(l)})^2\end{gather*}
@adrianlzt
adrianlzt / sysdig-snippets.md
Last active November 11, 2021 17:44 — forked from molotovbliss/sysdig-snippets.md
SYSDIG CHEAT SHEET
@adrianlzt
adrianlzt / radare2.md
Last active July 12, 2021 17:40
pulsesvc binary patching remove unwanted features, pulse-secure 9.1r5.0_b151-2

Modifications to pulsesvc.

Original pulsesvc binary md5sum: 7c17b24314af67bc7b86d4681884c844

Modified version md5sum: 274c9071501b6e66c75eec6e0f7d2559

Changes:

  • do not modify /etc/hosts
  • do not modify /etc/resolv.conf
  • do not add routes
@adrianlzt
adrianlzt / instructions.txt
Created July 9, 2020 07:07
CMDB not-complete build instructions
Download code from sourceforge (.tar.gz)
Deps needed:
https://bitbucket.org/tecnoteca/cmdbuild-dependencies/downloads/
Uncompress and install:
bash install-artifacts.sh
Copy those deps to our m2 local cache:
rsync -a . $HOME/.m2/repository/
@adrianlzt
adrianlzt / hx711-overlay.dts
Created March 26, 2020 15:19
Devicetree overlay for HX711 in Raspberry Pi Zero
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/";
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# https://gist.github.com/adrianlzt/216aabb9568b162c92317f768d889c76
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
@adrianlzt
adrianlzt / max.rb
Created February 26, 2019 08:58
stub
#!/bin/ruby
require 'json'
require 'stringio'
# Complete the maxSubsetSum function below.
def maxSubsetSum(arr)
end
@adrianlzt
adrianlzt / sharescreen
Last active January 7, 2022 07:14
Scripts to share only a portion of the screen
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor