Skip to content

Instantly share code, notes, and snippets.

View aaomidi's full-sized avatar

Amir Omidi aaomidi

  • Spirl
  • US
View GitHub Profile
@aaomidi
aaomidi / ghc.sh
Created November 20, 2023 01:44
Organize your github clones automatically
#!/usr/bin/env bash
# Extract the organization and repo name from the argument
ORG=$(echo "$1" | cut -d '/' -f 1)
REPO=$(echo "$1" | cut -d '/' -f 2)
# Define the base directory
BASE_DIR="$HOME/Projects"
# Create the directory structure
package main
import (
"bytes"
"flag"
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
Item #: SCP-XXXX
Object Class: Euclid
Special Containment Procedures: The process of going from draft to published Request for Comments (RFC) at the Internet Engineering Task Force (IETF) is to be closely monitored and documented by Foundation agents embedded within the IETF. These agents are to observe and record any deviations from standard protocol, as well as any anomalous activity that may occur during the process.
Any anomalous activity discovered during the process is to be reported immediately to the IETF Security Area Directors and the Foundation's Director of Information Security. The anomalous activity is to be contained and neutralized as quickly and efficiently as possible, with minimal disruption to the normal operation of the IETF.
Description: SCP-XXXX is the process of going from draft to published RFC at the IETF. This process involves multiple steps, including:
@aaomidi
aaomidi / Dockerfile
Last active January 18, 2022 16:01
firewalld blocking DNS when running in docker-compose & sysbox runtime
FROM centos:8
ENTRYPOINT [ "/sbin/init", "--log-level=err" ]
RUN yum install -y systemd openssh-server openssh-server bind-utils nc
RUN echo "root:1" | chpasswd
RUN echo "PermitRootLogin yes" > /etc/ssh/sshd_config
RUN yum install -y firewalld
@aaomidi
aaomidi / nat_rules
Last active September 2, 2018 15:39
Script to run the VPN
nat on utun2 from 192.168.2.0/24 to any -> (utun2)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Subnets</key>
<array>
<dict>
<key>allocate</key>
<true/>
<key>dhcp_domain_name_server</key>

There's been some active discussion on "Is this the switch expression construct we're looking for" over on amber-dev. Its a good time to take stock of where we are, and identifying any loose ends.

Approach

Our approach is driven not merely by the desire to have an expression form of switch, but to make switch more generally useful as a multi-way conditional construct. The biggest driver here of course is making it work well with pattern matching. Pattern matching is a driver for better

@aaomidi
aaomidi / AbstractClass.java
Last active December 5, 2017 17:42
Funky Java :)
public abstract class AbstractClass {
public void printClass() {
System.out.println(this.getClass().getName());
System.out.println(getClass().getName());
}
}
@aaomidi
aaomidi / Midterm.md
Created March 24, 2017 06:31
CS370 Midterm

CS370

Midterm

Question 1

Suppose as a programmer you have three options for providing mutual exclusion: disabling interrupts, a spin lock, and semaphores. What considerations would go into your decision for choosing one over the others?

  • Interrupt Control:

It simply does not allow the OS to preempt processes. If we're given one choice of these to provide mutex, this would, simply, be the worst idea possible. It could allow any process take over the entire CPU. For safety and santiy's sake this should be avoided.

##
# Hardware Based (Very high security)
##
# Yubikey 1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ3LihSrgy7aVvtHmJ8GwlDpXqSEPNtg897PUN5dHOMkJmlJK88kYRK/DdMHaeHoNXPlkWMkKx6McsgmX+TbqtBnzs2pm7IrkJeC0LmTN5EusolOLin2c3lXpApHtq9BgqaMmUrYUbOU0QAd9x9aW1jdeOnMAGX58f7hSAeUddkYvSW7G6ecwboWViZRF9bg91FTEONf/Aa+jPRgbpbSKms2jflNzn05u1b99himRIr0zkZfAl9BajKJq4Fucx/vDz/M2YE14etps/XBdRobAV+asN2+nr2pSGtAo4xqDfvvKkblSVe+yngG/5J0bbwGmOduXYmsW4sEja1V2YzdPWYzDCn0BiLoulGG9kbVB6JWtbsaOJynDicHwIjdyLtjqxnf3mwyugdUD+0vl+gKJyB7ZjOUXA2rflkz+21QBK9GdKjSBAs2ZKRyWfpAncxkf7t+WD+b42K93PW0LjqiCU6+VS2+wNK2m/e7J/x0ay84KOriYrSvbZt048xUOMBMdSUZ/YVmVv+6KldIUrKQMb6pB8HEoFYNaWM/vUhmld51cvYwXsRshjzz0FX+8ZaUBxVysBmM7v2ulI22qewKj0LjraobrKYVDFbwUgzLUwui4RbPr8ixTj4sDHhKF6DPktF7F/vfrB0LuWavwuuc3lMeXMmE7dQcX2C67zvIC77Q== cardno:000605448660
# Yubikey 2 (Backup)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCdRy4x2QdmnJje3FgsoZPW/x0Aw1J7I8aqCFih/NyP5sLTBxzs0uwC+JvREXFljS8w89d9upFgCCkQgX/Jk4SHcnutDP+tErMYzOaHD2SCVztqHfTcwUL+WYbTMAhvw671YrrmxvjUjTQ5afj7RZ6AaKS3B4XWP3Y0Cj