Freetalk is command line
- Its goodness
- Its richness
- Its flexibility
- Its power
#!/bin/bash | |
function ping_host () | |
{ | |
{ | |
exec 4<>/dev/tcp/$1/$2 | |
if [ $? -ne '0' ]; then | |
echo "Port not reachable" | |
return 1; | |
else |
def factorial (a: Int, b: Int): Int = if (a == 1) b else if (a == 0) 1 else factorial (a - 1, a * b) |
#!/usr/bin/env python | |
import psutil | |
import sys | |
def pmap_find(p, name): | |
for m in p.memory_maps(grouped=True): | |
if m.path.endswith("%s.so" % name): | |
return True | |
continue | |
return False |
# cat find_same_inode.stap | |
#!/usr/bin/stap -g | |
# Copyright (c) 2014 Brad Hubbard <[email protected]> | |
%{ | |
#include <linux/file.h> | |
%} | |
function find_same_inode:string (path:string) %{ | |
struct nameidata *nd; |
import cv2 | |
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') | |
cap = cv2.VideoCapture(0) | |
while(True): | |
# Capture frame-by-frame | |
ret, frame = cap.read() |
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
) | |
const ( | |
SPLIT_NFILES = 4 |
#!/usr/bin/stap | |
# | |
global write_errors, write_success | |
function handlewrite (pp, ret) { | |
if (ret < 0) | |
{ | |
printf("%s %s returned %d", tz_ctime(gettimeofday_s()), pp, ret) | |
write_errors[pp]++ | |
} |
# | |
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
# | |
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
# | |
# Alternative to http://www.groths.org/trim-enabler-3-0-released/ | |
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4 | |
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks | |
# And here: http://forums.macrumors.com/showthread.php?t=1410459 |