Skip to content

Instantly share code, notes, and snippets.

Piyush Katariya corporatepiyush

Block or report user

Report or block corporatepiyush

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Allocate CPU cores
// suppose you spawned 16 node processes on 16 core CPU
ps axf | grep node | grep -v grep | awk '{print $1}' | xargs -n 1 taskset -cp 0-15
corporatepiyush / pubsub-coordinator.sql
Created Sep 13, 2018 — forked from marcocitus/pubsub-coordinator.sql
Prototype for PubSub on PG 10 with Citus 7
View pubsub-coordinator.sql
/* commands to run on the coordinator */
SELECT master_add_node('', 5432);
SELECT master_add_node('', 5432);
SELECT start_metadata_sync_to_node(nodename, nodeport) FROM pg_dist_node;
SET citus.replication_model TO 'streaming'
event_id bigserial primary key,
View ngrams.js
const _ = require('ramda')
const ngrams = function (string) {
var r = [];
for (var n = 2; n <= string.length; n++)
for (var i = 0; i <= string.length - n; i++)
r.push(string.substring(i, i + n));
return r;
corporatepiyush /
Created Sep 4, 2017
Find file by name and copy to desired destination folder
find <directory> -name 'screen.png' | xargs -n1 cp <file/directory to be copied>
corporatepiyush /
Created Sep 4, 2017
Parallel Processing of Commands or Data
seq 1 10 | xargs -n1 -P5 <any command>
corporatepiyush /
Created Sep 4, 2017
Count Number of Lines in Project files
find $directory$ -type f -name "*.py" | xargs cat | wc -l
for keyfile in ~/.ssh/id_*; do ssh-keygen -l -f "${keyfile}"; done | uniq
corporatepiyush /
Last active Sep 4, 2017
Extract Unique Youtube URL from Given Page or Playlist Page with Jquery
// download audio files and convert them to mp3
cat links.txt | xargs -n1 -P2 youtube-dl --extract-audio --audio-format mp3 --audio-quality 9
You can’t perform that action at this time.