Skip to content

Instantly share code, notes, and snippets.

View skyzyx's full-sized avatar
👾
OOICU812

Ryan Parman skyzyx

👾
OOICU812
View GitHub Profile

Information is power. But like all power, there are those who want to keep it for themselves. The world’s entire scientific and cultural heritage, published over centuries in books and journals, is increasingly being digitized and locked up by a handful of private corporations. Want to read the papers featuring the most famous results of the sciences? You’ll need to send enormous amounts to publishers like Reed Elsevier.

There are those struggling to change this. The Open Access Movement has fought valiantly to ensure that scientists do not sign their copyrights away but instead ensure their work is published on the Internet, under terms that allow anyone to access it. But even under the best scenarios, their work will only apply to things published in the future. Everything up until now will have been lost.

That is too high a price to pay. Forcing academics to pay money to read the work of their colleagues? Scanning entire libraries but only allowing the folks at Google to read them? Providing scientific a

@skyzyx
skyzyx / lambda-sumologic.sh
Created July 19, 2018 22:25
Remove all #CloudWatch Log Groups for #Lambda functions forwarding to #SumoLogic
for lg in $(aws logs describe-log-groups --query "logGroups[?logGroupName | contains(@, 'aws/lambda/sumologic')].logGroupName" --output text); do
echo "$lg";
aws logs delete-log-group --log-group-name "$lg";
done;
@skyzyx
skyzyx / docker-datadog.sh
Created July 19, 2018 22:23
#Docker Engine API for #Datadog Agent
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/{id}/top" | jq
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .NetworkSettings.Networks.bridge.IPAddress'
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .Ports[] | select(.PublicPort) | .PublicPort'
curl -sSL \
--unix-socket /var/run/docker.sock \
"http:/v1.37/containers/json" \
| jq -r '
@skyzyx
skyzyx / dopcker-ipaddress-mapping.sh
Created July 19, 2018 22:21
#Docker mapping of IP addresses
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d7aab3bcecd4
@skyzyx
skyzyx / docker-port-mapping.sh
Created July 19, 2018 22:20
#Docker mapping of open ports
docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}}{{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d7aab3bcecd4
@skyzyx
skyzyx / sample-xpath-translate-faster.php
Last active July 19, 2018 21:53
Faster case-insensitive #XPath matches in #PHP
<?php
$word = 'rss';
$elementLetters = \count_chars($word, 3);
$lettersLower = \mb_strtolower($elementLetters);
$lettersUpper = \mb_strtoupper($elementLetters);
$query = \sprintf(
'/*[translate(name(), \'%s\', \'%s\') = \'%s\']',
$lettersUpper,
/*[translate(name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'rss']
@skyzyx
skyzyx / engineering-roles.md
Created December 11, 2017 19:58
Engineering Role Definitions

Engineering Role Definitions

Note: Although the levels may be different, these tend to map pretty cleanly to similar hierarchies at Google and Microsoft, but they have no correlation to hierarchies outside of the "club" of elite companies (Microsoft/Amazon/Google/Facebook, etc. on the west coast, Bloomberg/Goldman/HFT firms, etc. on the east coast).

People with 10-15 years of software engineering experience interview all the time at these companies, but they may not be fit for much more than a junior engineering role (SDE I or SDE II, depending on which company you're looking at).

Junior Engineer/Intern:

  • Is essentially a new and inexperienced (below the level of Amazon/Microsoft/Google engineers) junior engineer.
  • Attending college for computer science, or really good at teaching themselves from books and online tutorials.
@skyzyx
skyzyx / metadata
Last active August 30, 2017 00:09
SimplePie: Individual Contributor Non-Exclusive License Agreement including the Patent Pledge OPTION
{
"name": {
"title": "Full Name",
"type": "string",
"githubKey": "name",
"required": true
},
"email": {
"title": "Email",
"type": "string",
@skyzyx
skyzyx / strftime-php71-alpine.sh
Created July 24, 2017 18:14
strftime() %P modifier broken in PHP 7.1.7 on Alpine Linux 3.4
# Working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%c', time()));"
#=> string(24) "Mon Jul 24 18:09:54 2017"
# Also working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%I:%M%p', time()));"
#=> string(7) "06:12PM"
# Not working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%I:%M%P', time()));"