This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT=project | |
PROJECT_NUMBER=1343214123423 | |
# GKE | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@container-engine-robot.iam.gserviceaccount.com --role=roles/container.serviceAgent | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@containerregistry.iam.gserviceaccount.com --role=roles/editor | |
# Compute | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/editor | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/compute.serviceAgent | |
# APIs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for personal github.com | |
ssh-keygen -t rsa -C "[email protected]" | |
# save it as id_rsa (which is default) | |
# for company | |
ssh-keygen | |
# save it as id_rsa_XXX (which is NOT default) when prompted | |
# delete cached ids | |
ssh-add -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04 | |
sudo mysql -u root | |
systemctl status mysql.service | |
sudo mysqladmin -p -u root version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: This installation is applicable for installing leiningen in Windows system till date | |
:: #1 Create .lein folder under HOME directory | |
:: like C:\Users\gautamr\.lein | |
:: #2 Download lein.bat | |
:: https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat | |
:: #3 Download standalone ZIP of latest version | |
:: https://github.com/technomancy/leiningen/releases/download/2.8.1/leiningen-2.8.1-standalone.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 Download Haskell platform from https://www.haskell.org/platform/. Select 64 bit Windows version .exe | |
#2 Remove any previous Haskell installation - haskell home, cabal directory. Uninstall stack with uninstall-stack.exe inside C:\Users\User\AppData\Roaming\local\bin | |
#3 Run the installer. Don't select any PATH change autometically during installation. Not for stack also. Don't select auto creation of STACK_ROOT | |
#4 Create HASKELL_HOME, STACK_HOME and STACK_ROOT system variable with proper path. Add that to PATH manually. | |
HASKELL_HOME=C:\Haskell Platform\8.2.1 | |
STACK_HOME=C:\Haskell Platform\stack | |
STACK_ROOT=C:\Haskell Platform\stack\sr | |
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%GIT_HOME%\cmd;%GIT_HOME%\bin;%M2_HOME%\bin;%GRADLE_HOME%\bin;%AMAZON_HOME%\AWSCLI\;%NPM_HOME%;%NODEJS_HOME%;%RUBY_HOME%\bin;C:\GNU\GnuPG\pub;C:\scala\bin;C:\sbt\bin;%HADOOP_HOME%\bin;%HADOOP_HOME%\sbin;%SPARK_HOME%\bin;%ATOM_HOME%\bin;%EMACS_HOME%\bin;%ASPELL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fibo [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Maps are function | |
(def inventors {:Lisp "McCarthy" :Clojure "Hickey"}) | |
(inventors :List) | |
;; -> McCarthy | |
;; But if you want to get something agianst nil then use get | |
(get inventors :Scala "Who?") | |
;; -> Who? | |
;; keywords are function; so following two give same output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CATALINA_BASE_APPS="/home/XXX/apache/tomcat-7.0.70-instance-XXX" | |
APP_DIST="$WORKSPACE/XXX/XXX" | |
APP="XXX" | |
PID_FILE="$CATALINA_BASE_APPS/tomcat7-XXX.pid" | |
if [ -f "$PID_FILE" ] | |
then | |
echo "PID file exists: $PID_FILE" | |
PID=$(<"$PID_FILE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add user; you need to set all things manually | |
useradd gautamr | |
# better to do this; home etc. will be created | |
adduser gautamr | |
# set the password for gautamr | |
passwd gautamr | |
# add sudo permission to gautamr | |
sudo usermod -aG sudo gautamr |
NewerOlder