Skip to content

Instantly share code, notes, and snippets.

View prashant-shahi's full-sized avatar
:shipit:
Working remotely

Prashant Shahi prashant-shahi

:shipit:
Working remotely
View GitHub Profile
# uname -a
# Linux ip-172-31-1-128 5.4.0-1038-aws #40-Ubuntu SMP Fri Feb 5 23:53:34 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
git clone --depth=1 --branch=docker_server_from_ci_builds https://github.com/filimonov/ClickHouse.git
cd ClickHouse/docker/server/
docker build . --network host --build-arg single_binary_location="https://builds.clickhouse.tech/master/aarch64/clickhouse"
docker image ls
docker tag 98f169cda25a altinity/clickhouse-server:21.4.1.6307-testing-arm
docker login
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@prashant-shahi
prashant-shahi / sharebuttons.html
Created March 12, 2021 12:49 — forked from juanbrujo/sharebuttons.html
lightweight share buttons with vanilla javascript
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" class="share facebook">Facebook</a>
<a href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>&via=twitter" class="share twitter">Twitter</a>
<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" class="share google">Google+</a>
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&source=LinkedIn.com&title=<?php the_title(); ?>" class="share linkedin">LinkedIn</a>
@prashant-shahi
prashant-shahi / delete_git_submodule.md
Created March 8, 2021 10:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@prashant-shahi
prashant-shahi / request-promises.js
Created September 2, 2020 19:53 — forked from pdonham/request-promises.js
Using async.waterfall to synchronize aggregation of results when using promises
/*
Small demo to show chaining of API calls. We're using these APIs:
https://weathers.co for current weather in 3 cities, and
https://api.github.com/search/repositories?q=<term> to search GitHub repos for
the 'hottest' city. For example, we'll grab weather for 3 cities, pick the hottest one,
then hit GitHub with a search for repos that have that city's name. A bit nonsensical
but I just wanted to demonstrate using the results of one API call to populate a second.
The problem we're trying to solve is that the API calls are asynch, and one of them
(getCityTemperatures) loops through several asynch calls (one for each city), and they
@prashant-shahi
prashant-shahi / network-tweak.md
Created July 15, 2020 07:52 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@prashant-shahi
prashant-shahi / allow-privileged-for-microk8s.md
Created June 3, 2020 02:12 — forked from antonfisher/allow-privileged-for-microk8s.md
MicroK8s add --allow-privileged=true flag

Add --allow-privileged=true to:

# kubelet config
sudo vim /var/snap/microk8s/current/args/kubelet

#kube-apiserver config
sudo vim /var/snap/microk8s/current/args/kube-apiserver

Restart services:

@prashant-shahi
prashant-shahi / allow-privileged-for-microk8s.md
Created June 3, 2020 02:12 — forked from antonfisher/allow-privileged-for-microk8s.md
MicroK8s add --allow-privileged=true flag

Add --allow-privileged=true to:

# kubelet config
sudo vim /var/snap/microk8s/current/args/kubelet

#kube-apiserver config
sudo vim /var/snap/microk8s/current/args/kube-apiserver

Restart services:

const convertToKebabCase = (string) => {
return string.replace(/\s+/g, '-').toLowerCase();
}
@prashant-shahi
prashant-shahi / interval.js
Created December 18, 2019 11:10 — forked from ncou/interval.js
setTimeout and setInterval with pause and resume
// http://stackoverflow.com/questions/7279567/how-do-i-pause-a-window-setinterval-in-javascript
function RecurringTimer(callback, delay) {
var timerId, start, remaining = delay;
this.pause = function() {
window.clearTimeout(timerId);
remaining -= new Date() - start;
};