irb
- command to launch ruby interpreter in any directory
rails c
- command lets you interact with your Rails application from the command line
reload!
- reload rails environment if you had changed model functionality
gem outdated
- show all outdated gems on project
gem update [<gem_name>]
- update a specific gem
./bin/webpack-dev-server
- start webpacker dev server for fast compiling
code $(bundle show gem_name)
- shortcut to open a Ruby gem in VS Code
whoami
current user name
hostname
current pc name
cat /etc/os-release
- info about current system
getent group sudo | cut -d: -f4
- show all sudo users
su - user2
- switch between users
sudo chmod a+rwx folderName/*
add all access to the folder
chown -R username directory
- add full permission directory and to all files and directories in that directory
chowd -R u+rX directory
- the same as previous
Configuration files for Rails-driven project basic continuous integration using GitHub Actions and GitLab CI. | |
2020, amkisko (Andrei Makarov). |
#!/bin/bash | |
# License for this script is GNU 2 | |
# A small bash script to download, compile and install latest wgrib2 from source. | |
# I have written this script so that I can automate the proceedure whenever I change Linux OS | |
# Make it executable before running the script using'chmod +x ./wgrib2_auto_compile_script.sh' | |
# Ensure to run the script with sudo (sudo ./wgrib2_auto_compile_script.sh) or under root environment |
The PATH
is an important concept when working on the command line. It's a list
of directories that tell your operating system where to look for programs, so
that you can just write script
instead of /home/me/bin/script
or
C:\Users\Me\bin\script
. But different operating systems have different ways to
add a new directory to it:
- The first step depends which version of Windows you're using:
- If you're using Windows 8 or 10, press the Windows key, then search for and
The first step is to remove older version of PostGIS if any.
sudo apt-get purge postgis
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
cd /path/to/your/repo | |
curl https://gist.githubusercontent.com/johnhamelink/577b8613ae82d2b3037b/raw/ad71fb72a1b86ee9a90ac62eccc4a55367578625/pre-push.sh > .git/hooks/pre-push | |
chmod u+x .git/hooks/pre-push |
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
var colorArray = ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6', | |
'#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D', | |
'#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A', | |
'#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC', | |
'#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC', | |
'#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399', | |
'#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680', | |
'#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933', | |
'#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3', | |
'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF']; |