Skip to content

Instantly share code, notes, and snippets.

View waheedi's full-sized avatar

Waheed Barghouthi waheedi

View GitHub Profile
@waheedi
waheedi / german-driving-license.md
Created September 28, 2024 07:35 — forked from blessanm86/german-driving-license.md
Quick Ref Notes for German Driving License Test

This is unmaintained and was created for personal use. As I passed the exam I have no use to keep this up to date. Feel free to fork

What are the consequences for a person driving a motor vehicle under the influence of drugs (e.g. hashish, heroin, cocaine)?

[x] Confiscation of driving licence or driving ban
[x] Compulsory medical/psychological examination
[x] Fine and/or imprisonment

In which instances do you have to approach a pedestrian crossing with particular care?

@waheedi
waheedi / drugs_and_alcohol.md
Created September 28, 2024 07:35 — forked from ShkurtiA/drugs_and_alcohol.md
Fahrschule, driving license germany, berlin

Drugs and Alcohol

How is the intoxicating substance in hashish broken down by the body?

  • Unevenly over an indeterminate period

In general, how long does it take before an alcohol level of 1.0 per mille (100mg/100ml) is cleared from the blood stream?

  • 5 hours
  • 10 hours
  • 1 hour
@waheedi
waheedi / iptables.sh
Last active June 6, 2020 09:56 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show enp0s31f6 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
waheed:~$ python3.7 test_ssl.py
os: Darwin-19.5.0-x86_64-i386-64bit
python 3.7.7 (default, Mar 10 2020, 15:43:33)
[Clang 11.0.0 (clang-1100.0.33.17)]
requests: 2.23.0
certifi.where: /usr/local/lib/python3.7/site-packages/certifi/cacert.pem
=== test 1 ===
<Response [200]>
=== test 2 ===
=== test 3 ===
@waheedi
waheedi / cleanup.sh
Last active May 5, 2020 12:20 — forked from itskenny0/cleanup.sh
Cleanup script for salt minions affected by recent CVE exploitation - https://github.com/saltstack/salt/issues/57057
#!/bin/bash
## Executing this script is not a guarantee for a secure host!
## This script is a collection of the junk I have found on my hosts and what
## the SaltStack community gave as input. We have seen this attack evolve.
## Please have a very close look at your systems and consider reinstalling them
## to be absolutely sure you are free of malware.
# remove all the trash
rm /etc/salt/pki/minion/minion_master.pub
require "minitest/autorun"
module Test
VERSION = "0.1.0"
# TODO: Put your code here
end
@waheedi
waheedi / gist:059db9f1b0a35c906aed77b408af4f5e
Created May 22, 2019 00:17 — forked from perusio/gist:2154235
High performance tuning of Nginx
## From a post on the ML, apropos this:
## http://lowlatencyweb.wordpress.com/2012/03/20/500000-requestssec-modern-http-servers-are-fast.
## For sysctl.conf
net.ipv4.tcp_slow_start_after_idle = 0
echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
@waheedi
waheedi / rubymethodlookup.md
Created February 19, 2019 21:09 — forked from damien-roche/rubymethodlookup.md
A Primer on Ruby Method Lookup

A Primer on Ruby Method Lookup

Method lookup is a simple affair in most languages without multiple inheritance. You start from the receiver and move up the ancestors chain until you locate the method. Because Ruby allows you to mix in modules and extend singleton classes at runtime, this is an entirely different affair.

I will not build contrived code to exemplify the more complicated aspects of Ruby method lookup, as this will only serve to confuse the matter. If you are having trouble following method lookup in your own programs, it is not because Ruby has strange rules (it does), it is because your code is too tangled.

When you pass a message to an object, here is how Ruby finds what method to call:

1. Look within singleton class

@waheedi
waheedi / SupplyChain.sol
Created October 4, 2018 11:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract SupplyChain {
address public supplier;
address public shipper;
address public customer;
uint public shipment_id;
uint public shipment_price;
uint public shipment_status; // status {delivered: 1, processing: 2, started: 3, initiated: 0}