Skip to content

Instantly share code, notes, and snippets.

View noushi's full-sized avatar

Reda NOUSHI noushi

  • EDC4IT
  • EMEA Literally
View GitHub Profile
@dpoulopoulos
dpoulopoulos / nlsh.py
Last active June 14, 2023 11:25
OpenAI natural language shell example.
prompt = """
Input: Print the current directory
Output: pwd
Input: List files
Output: ls -l
Input: Change directory to /tmp
Output: cd /tmp
@bmoyles
bmoyles / 52-ec2-xen-vbd-devices.rules
Created March 19, 2019 17:29
ec2 vbd and NVMe udev rules and helpers
# ensure any xen virtual block devices named xvdN get a sdN symlink for consistency
KERNEL=="xvd*", PROGRAM="/sbin/ec2udev-vbd %k", SYMLINK+="%c"
@smford22
smford22 / main.tf
Created May 21, 2018 19:15
terraform GCP remote exec
/*
This is a test server definition for GCE+Terraform for GH-9564
*/
provider "google" {
project = "${var.project}" // Your project ID here.
region = "${var.region}"
}
resource "google_compute_firewall" "gh-9564-firewall-externalssh" {
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 22, 2024 16:30
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@junaidk
junaidk / ec2.sh
Last active July 7, 2023 04:55
Get List of EC2 instances from All regions
# install aws cli first and configure it with credentials and default region
# the script will iterate over all regions of AWS
for region in `aws ec2 describe-regions --output text | cut -f4`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region
done
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active April 4, 2024 13:03
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 17, 2024 22:50
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active April 14, 2024 02:35
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@maxtruxa
maxtruxa / Antonyms.md
Last active April 3, 2024 22:51
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@yuanying
yuanying / vagrant-kvm.md
Last active April 17, 2024 08:12
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user