Skip to content

Instantly share code, notes, and snippets.

View alep's full-sized avatar
🐙
Vamo' a calamarno

Alejandro Peralta alep

🐙
Vamo' a calamarno
View GitHub Profile
@alep
alep / tcp_flags.txt
Created August 15, 2023 12:54 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@alep
alep / CONDTIONALS
Created April 23, 2021 15:54 — forked from alptugan/CONDTIONALS
Sonic Pi Cheat Sheet
So, let’s flip a coin: if it’s heads, play a drum, if it’s tails, play a cymbal. Easy. We can emulate a coin flip with our one_in function (introduced in the section on randomness) specifying a probability of 1 in 2: one_in(2). We can then use the result of this to decide between two pieces of code, the code to play the drum and the code to play the cymbal:
loop do
if one_in(2)
sample :drum_heavy_kick
else
sample :drum_cymbal_closed
end

Keybase proof

I hereby claim:

  • I am alep on github.
  • I am alep (https://keybase.io/alep) on keybase.
  • I have a public key ASB5OL0YFwaQhbCxoVZbHr9cUkILo_YgfXg2isMxUQdl7go

To claim this, I am signing this object:

@alep
alep / curl.md
Created July 5, 2017 14:35 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

#python3
import numpy as np
from itertools import product
from scipy.spatial.distance import euclidean
coords = [(35.0456, -85.2672),
(35.1174, -89.9711),
(35.9728, -83.9422),
(36.1667, -86.7833)]
@alep
alep / main.go
Last active August 29, 2015 14:27
Web crawler from the tour of go.
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
[Desktop Entry]
Version=24.5
Name=Emacs
Exec=env UBUNTU_MENUPROXY=0 /usr/local/bin/emacs-24.5
Terminal=false
Icon=/usr/local/share/icons/hicolor/128x128/apps/emacs.png
Type=Application
Categories=IDE
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
@alep
alep / introrx.md
Last active August 29, 2015 14:26 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alep
alep / ipython output
Created February 13, 2015 19:42
Strange results when pivoting, doesnot group by day as expected.
In [1]: %load test.py
In [2]: import pandas as pd
import numpy as np
frame = pd.read_csv("table.csv", engine="python", parse_dates=['since'])
print frame
d = pd.pivot_table(frame, index=pd.TimeGrouper(key='since', freq='1d'), values=["value"], columns=['id'], aggfunc=np.sum, fill_value=0)
print d
print "^that is not what I expected"