Skip to content

Instantly share code, notes, and snippets.

@benbek
benbek / go.mod
Created October 26, 2021 14:52
OpenTelemetry + APM Metrics issue
module otel-example
go 1.17
require (
github.com/rs/zerolog v1.25.0
go.opentelemetry.io/otel v1.0.1
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.24.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.24.0
go.opentelemetry.io/otel/metric v0.24.0
@benbek
benbek / replace-classes-in-apk.sh
Last active January 29, 2019 15:08 — forked from sebfisch/replace-classes-in-apk.sh
Replaces classes in Android Package Files
#!/bin/sh
# Replaces classes in Android Package Files
# (c) Sebastian Fischer, CC-BY
# Enhanced by Ben Bek
# Can be used to rebuild an App with a modified version of a used library.
exists()
{
@benbek
benbek / Life.PAS
Created December 9, 2016 22:32
Game of Life homework project, February 2003
{ ָ ¾ ´ × © ° ± ² ³ µ ¶ · ¸ ¹ ÷ » ¼ ½ ¿ ְ ֱ ֲ ֳ ִ ֵ ֶ ַ ֹ ֺ ֻ ּ
ֽ ־ ֿ ׀ ׁ ׂ ׃ װ ױ ײ ׳ ״        }
Program Life;
Uses CRT;
Const MAXGEN = 25 ;
Const MATSIZE = 8 ;
Const GENTIME = 750;
@benbek
benbek / Equation.pas
Created December 9, 2016 22:30
Quadratic equation solver homework, March 2003
{ INPUT: The coefficients and terms
OUTPUT: The equation with its roots, if applicable }
Program Equation;
Uses Crt;
Var A, B, C : Integer; { Stores the parameters }
Ax,Bx,Cx: String; {Temporarly stores the parameters}
Desc : Integer; { Stores the discriminant }
X1 : Real; { Stores the first root }
X2 : Real; { Stores the second root }
ValCode : Integer; {Required for Val to work}
@benbek
benbek / Nibbles.c
Created December 9, 2016 22:12
Amateur Snake game homework, October 2003
/* Nibbles/Snake
Programmed during the Sukkot holiday by Ben Bekerman */
#include <conio.h> //Basic header file
#include <stdlib.h> //Required by Randomize() and Random()
#include <string.h> //Required for string functions
#include <time.h> //Required by Randomize()
#include <dos.h> //Required by Delay() and by Sound()
/* Defines (consts) */
@benbek
benbek / Appoint.c
Created December 9, 2016 22:07
Appointments calendar Passover project, April 2004
/* A P P O I N T M E N T
A Schedule program written in C
Passover 2004 */
#include <stdio.h> //Basic header file
#include <conio.h> //Basic header file
#include <dos.h> //Mouse, sound, etc. header file
#include <stdlib.h> //Supplemental services (exit(), etc.)
#include <alloc.h> //Memory allocation services
#include <time.h> //Timing and dates header file
@benbek
benbek / Calendar.c
Created December 9, 2016 21:59
Appointments calendar homework, 2004
#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#include <graphics.h>
typedef struct Meetings {
int Hour;
@benbek
benbek / 1501.asm
Created December 9, 2016 21:57
OpenU 80286 Assembly exercise, July 2008 Raw
;; MAMAN 15
;; Question 1
P286N
IDEAL
DOSSEG
MODEL SMALL
STACK 100h
MAXIMUM = 20 ; Maximum characters to read off the keyboard
@benbek
benbek / ldap-list.sh
Created May 15, 2016 19:34
Get a formatted list of all employees from LDAP
#!/bin/bash
# sort people by username (column 2) alphabetically
ldapsearch -H ldap://ldap.SERVER.com -x -b dc=__DOMAIN__,dc=com | grep ^# | sed -e 's/#//' -e 's/,//g' -e 's/ __DOMAIN__.com//' -e 's/ People//' | sort -k 2
@benbek
benbek / curl-with-proxies-from-file.sh
Last active May 2, 2016 15:24
OS X: Read off a list and perform a command
cat FILE | ruby -e 'puts STDIN.readlines.shuffle' | xargs -t -I {} curl -x {}:80 -U {user}:{password} -o ~/Desktop/whatever/{} -m 15 'https://www.cnn.com/'
cd ~/Desktop/whatever
grep -il '\\n,\\x22String that exists' * | sort | wc -l
grep -iL '\\n,\\x22String that does not\\x22' * | wc -l