Set up project:
mkdir project
cd project
npm init -y
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
While on a branch with a couple of commits, you can edit a commit with interactive rebase. This should be used sparingly and only on branches and never on master.
$ git checkout my-branch
$ git log
#!/bin/bash | |
list=$(docker ps) | |
IFS=$'\n' array=($list) | |
for index in "${!array[@]}" | |
do | |
declare -a a=("${array[index]}") | |
printf "%s\n" "${a[@]}" | |
done |
#!/bin/sh | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
then | |
>&2 echo 'ERROR: Invalid installer signature' | |
rm composer-setup.php |
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
function help-fn { | |
echo "`cat <<EOF | |
############################################################################ | |
# # | |
# ------- Useful Docker Aliases -------- # | |
# # | |
# # Installation : # | |
# copy/paste these lines into your .bashrc or .zshrc file or just # | |
# type the following in your current shell to try it out: # | |
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash |
# List of cheatsheet for linux find. | |
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml | |
# basic 'find file' commands | |
# -------------------------- | |
find / -name foo.txt -type f -print # full command | |
find / -name foo.txt -type f # -print isn't necessary | |
find / -name foo.txt # don't have to specify "type==file" | |
find . -name foo.txt # search under the current dir | |
find . -name "foo.*" # wildcard |
{ | |
"sonarlint.disableTelemetry": true, | |
"sonarlint.ls.javaHome": "/usr/lib/jvm/java-17-openjdk-amd64", | |
"sonarlint.output.showAnalyzerLogs": true, | |
"sonarlint.output.showVerboseLogs": true, | |
"sonarlint.trace.server": "verbose", | |
"python.autoComplete.extraPaths": [ | |
"/home/project/src", | |
], | |
"python.analysis.extraPaths": [ |