Skip to content

Instantly share code, notes, and snippets.

View abarrak's full-sized avatar

Abdullah Barrak abarrak

View GitHub Profile
@abarrak
abarrak / pcp_install.sh
Last active September 17, 2023 12:12
Performance Copilot
#!/usr/bin/env bash
## installation ..
#
yum install -y pcp pcp-gui pcp-system-tools pcp-doc
systemctl start pmcd
## explore ..
#
@abarrak
abarrak / python_env.sh
Created December 24, 2022 17:16
Python Workspace
#!/bin/bash
mkdir my_project && cd my_project
python3.9 -m venv venv
. venv/bin/activate
echo "flask==2.22" > requirements.txt
pip3.9 install -r requirements.txt
@abarrak
abarrak / cockpit.sh
Last active September 16, 2022 17:01
Install & Allow Cockpit on RHEL
sudo yum install cockpit
systemctl enable --now cockpit.socket
sudo firewall-cmd --add-service=cockpit --permanent
sudo firewall-cmd --reload
@abarrak
abarrak / protect-branch-against-delete.sh
Created February 26, 2022 14:59
Script: protect Bitbucket repositories form accidental deletion
#!/usr/bin/env bash
##
# This scripts protects the specified branches (e.g. dev) from deletion.
#
# *Usage:*
# ========
# protect-branch-against-delete <user> <pass> : [ <branch-name> <api-base-url> ]
#
# *Prerequisites:*
@abarrak
abarrak / .oidc-user-kube
Created February 9, 2022 12:32
A .kube config file for auto authentication to Kubernetes Cluster using OIDC
apiVersion: v1
clusters:
- cluster:
server: https://my-cluster.net
name: cluster-net
contexts:
- context:
cluster: my-cluster.net
user: oidc
name: cluster-user
@abarrak
abarrak / alias_matchers.md
Created September 10, 2021 15:01 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
# Using these pry gems -- copy to your Gemfile
# group :development, :test do
# gem 'awesome_print' # pretty print ruby objects
# gem 'pry' # Console with powerful introspection capabilities
# gem 'pry-byebug' # Integrates pry with byebug
# gem 'pry-doc' # Provide MRI Core documentation
# gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB
# gem 'pry-rescue' # Start a pry session whenever something goes wrong.
# gem 'pry-theme' # An easy way to customize Pry colors via theme files
# end
@abarrak
abarrak / convet_to_mpeg4.sh
Created November 21, 2020 23:26
Convert Outdated or Broken AVI files of VIDX streams to MPEG4 streams
for i in *.avi; do
ffmpeg -i "$i" -c:v mpeg4 -q:v 3 "ed_$i"
done
@abarrak
abarrak / install.sh
Last active October 3, 2019 21:06
Node.js Install on AWS EC2
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_11.x | sudo -E bash -
yum install nodejs
node -v
npm -v
@abarrak
abarrak / currencies.js
Last active February 8, 2023 19:55
ISO 4217 Currencies List - Javascript
{
'US Dollar (USD)': 'USD',
'Euro (EUR)': 'EUR',
'Pound Sterling (GBP)': 'GBP',
'Australian Dollar (AUD)': 'AUD',
'Afghani (AFN)': 'AFN',
'Lek (ALL)': 'ALL',
'Algerian Dinar (DZD)': 'DZD',
'Kwanza (AOA)': 'AOA',
'East Caribbean Dollar (XCD)': 'XCD',