Skip to content

Instantly share code, notes, and snippets.

View yrsdi's full-sized avatar
👋
Hi

Yadi Rosadi yrsdi

👋
Hi
View GitHub Profile
@yrsdi
yrsdi / clojure-learning-list.md
Created December 4, 2022 00:06 — forked from ssrihari/clojure-learning-list.md
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@yrsdi
yrsdi / php-oci-blob-storedproc.md
Created May 20, 2022 07:34 — forked from umidjons/php-oci-blob-storedproc.md
Execute stored procedure with BLOB parameter in PHP with OCI

Execute stored procedure with BLOB parameter in PHP with OCI

<?php
define('DB_USER','user1');
define('DB_PSWD','pswd1');
define('DB_CONN_STR','MYTNS');
define('DB_CHARSET','AL32UTF8');
@yrsdi
yrsdi / test.php
Created November 12, 2021 14:11 — forked from scribu/test.php
Simulate threads in PHP using only proc_open() and co.
<?php
include __DIR__ . '/threads.php';
$commands = array();
for ( $i=0; $i<10; $i++ ) {
$commands[] = "bash -c 'sleep `shuf -i 1-5 -n 1`; echo $i'";
}
@yrsdi
yrsdi / ansible_ad_hoc_inventories.md
Created August 3, 2021 03:12 — forked from alces/ansible_ad_hoc_inventories.md
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

@yrsdi
yrsdi / docker_rabbitmqctl.md
Last active June 25, 2020 22:00 — forked from jemc/docker_rabbitmqctl.md
Controlling Docker RabbitMQ via rabbitmqctl

Example invocation of a RabbitMQ docker container (use -d instead of -t -i to run in the background):

docker run -t -i --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

Example of controlling the rabbitmq-server inside the container using rabbitmqctl (also inside the container).

docker exec rabbitmq rabbitmqctl status
@yrsdi
yrsdi / meminfo.sh
Created May 8, 2020 06:41 — forked from csko/meminfo.sh
Bash script to display memory usage per user.
#!/bin/bash
ps ax --no-headers -o user,rss,vsize | awk '{a[$1]+=$2; b[$1]+=$3}END{for (i in a){printf("%-15s%10d MB%10d MB\n", i, int(a[i]/1024), int(b[i]/1024))}}' | sort -k 2,3 -r -g \
| awk '{sum += $2; sum2 += $4; print $0} END {printf("-----------------------------------------\n%-15s%10d MB%10d MB\n", "TOTAL", sum, sum2)}'
@yrsdi
yrsdi / gist:73172e1cede6cefdc53151d4a0f3aa8f
Created September 29, 2019 17:01 — forked from RalfNorthman/gist:4204ed3afda04d2ead43ba3330e7b786
Installing Elm on Antergos (ArchLinux)
sudo pacman -S npm
sudo npm install --unsafe-perm -g elm elm-test elm-oracle elm-format
sudo ln -s /usr/lib/libtinfo.so /usr/lib/libtinfo.so.5
# Add this to your .vimrc if you use Vim with Vundle:
Plugin 'ElmCast/elm-vim'
@yrsdi
yrsdi / io-monitor.sh
Created September 20, 2019 06:16 — forked from azhargiri/io-monitor.sh
Simple script to dump iostat command to CSV file
#!/bin/sh
###
## The original code is taken from snippet https://pastebin.com/SxxuaVy4
## Thank's to Harry Sufehmi
##
## Usage:
## Simply put in your crontab.
## Example below will run io-monitor.sh every minutes
## */1 * * * * /path/to/you/io-monitor.sh
@yrsdi
yrsdi / mysite.com
Created September 19, 2019 05:35 — forked from nuhil/mysite.com
Nginx Configuration for Slim
# Assume that inside the 'Slim' directory,
# there is another directory named 'api' inside which there is the index.php file
# '/home/vagrant/Code/' is simply a synched folder from host machine to this directory
server {
listen 80;
server_name www.mysite.com mysite.com;
root /home/vagrant/Code/Slim;
try_files $uri /api/index.php;