Skip to content

Instantly share code, notes, and snippets.

View User9000's full-sized avatar

Carlo Lam User9000

  • El Centro, CA
View GitHub Profile
@Integralist
Integralist / C vs System Calls.md
Last active January 30, 2023 05:08
C vs System Calls and where to find documentation?

What's the issue?

It can be confusing sometimes knowing where to look for documentation when dealing with C †

† that is if you're not a systems engineer, and have no CS degree, nor learnt C

As an example, you might learn about the strace command and start investigating what your Ruby application is up to. In doing so you'll see lots of calls to different functions and you might decide you want to look up the documentation for those functions.

This could be where your first problem arises. You might think "Ruby is written in C, so I'll look at the C documentation" and then come up with nothing.

@iamnewton
iamnewton / stocks
Created April 24, 2015 06:41
Allows you to grab stocks from a CLI
#!/usr/bin/env bash
#
# Author:
# Newton (@chrisohpedia)
#
# Description:
# Get stock quotes
#
# Dependencies:
# None
@hagope
hagope / stock.sh
Created August 6, 2014 16:14
Realtime Stock Quote from Google Finance using cURL
#!/bin/bash
# Usage: stock.sh TWTR 30
# Say TWTR current price every 30 seconds
while true
do
curl -s https://www.google.com/finance?q=$1 | grep ref_ -m 1 | sed 's|<[^>]*>||g' | say
sleep $2
done
@consti
consti / hosts
Last active September 5, 2024 17:11
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active August 6, 2024 15:45
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: