Skip to content

Instantly share code, notes, and snippets.

View HanjoStudy's full-sized avatar

HanjoStudy

  • Cape Town
View GitHub Profile
@HanjoStudy
HanjoStudy / github.sh
Created September 20, 2023 13:23
Github reset before prod
# Create a new orphan branch
git checkout --orphan temp_branch
# Add files to new branch
git add -A
git commit -m "Initial commit"
# Delete original master branch
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
# Option 1: Clone from github -------------------------------
# Create token in Github, use pat as password
# Use dedicated Repo PAT, owner to distribute
# Option 1: Clone from github -------------------------------
# apt-get install git-flow
# Create token in Github
tar --use-compress-program="pigz -6 --recursive" -cf "api__$(date +'%Y%m%d').tar.gz" api &
tar -xvzf foo.tar.gz
@HanjoStudy
HanjoStudy / extensions
Last active April 10, 2023 13:38
Rstudio vscode settings
# code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension akamud.vscode-theme-onedark
code --install-extension bianxianyang.htmlplay
code --install-extension DavidAnson.vscode-markdownlint
code --install-extension foxundermoon.shell-format
code --install-extension geddski.macros
code --install-extension hediet.vscode-drawio
code --install-extension jithurjacob.nbpreviewer
code --install-extension kylebarron.stata-enhanced
@HanjoStudy
HanjoStudy / furrrparallel.R
Last active February 17, 2021 22:17
Furrr makePSOCKcluster
library(furrr)
library(parallel)
cl <- makePSOCKcluster(3)
plan(cluster, workers = cl)
future_map_dfr(...)
stopCluster(cl)
@HanjoStudy
HanjoStudy / rjava.sh
Created January 29, 2021 21:29
rjava install
# datawookie
# https://github.com/datawookie
sudo apt-get install -y default-jre
sudo apt-get install -y default-jdk
sudo R CMD javareconf
> install.packages("rJava")
@HanjoStudy
HanjoStudy / roracle.sh
Last active April 4, 2022 13:03
Install ROracle
https://thraxys.wordpress.com/2016/10/25/install-roracle-on-linux/
# Downloads -------------------------------------------------------------
wget https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-devel-19.8.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-jdbc-19.8.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-odbc-19.8.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
@HanjoStudy
HanjoStudy / .profile
Created August 17, 2020 12:49
git_console
if(requireNamespace("prompt", quietly = TRUE)){
#devtools::install_github("gaborcsardi/prompt@x")
prompt_git <- function( ... ){
paste0(
"[", prompt::git_branch(), "]", ">"
)
}
prompt::set_prompt(prompt_git)
rm(prompt_git)
}
function docker_rm_exits(){
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
}
function docker_stop_rm(){
docker stop $1
docker rm $1
}