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
## Awesome Guidelines | |
https://github.com/Kristories/awesome-guidelines | |
## List of Free Learning Resources | |
https://github.com/EbookFoundation/free-programming-books | |
## Angular 2+ Components & Libraries | |
https://github.com/brillout/awesome-angular-components | |
## বাংলায় শেল ও শেলস্ক্রিপ্টিং শেখার কোর্স https://sh.howtocode.com.bd |
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
# Refresh ubuntu keys server | |
$ sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com | |
# Group permission change | |
$ sudo chgrp -R root esdata | |
# Add current login User ID to .bashrc or .zshrc file | |
$ echo "export UID=$UID" >> ~/.bashrc | |
or | |
$ echo "export UID=$UID" >> ~/.zshrc |
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
## python 3.7 install | |
-> sudo apt update | |
-> sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget | |
-> sudo apt install software-properties-common | |
-> sudo add-apt-repository ppa:deadsnakes/ppa | |
-> sudo apt update | |
-> sudo apt install python3.7 | |
-> python3.7 --version | |
## pip3 install |
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
If you want to run docker as non-root user then you need to add it to the docker group. | |
1. Create the docker group if it does not exist | |
$ sudo groupadd docker | |
2. Add your user to the docker group. | |
$ sudo usermod -aG docker $USER | |
3. Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first) | |
$ newgrp docker | |
4. Check if docker can be run without root | |
$ docker run hello-world | |
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
# Check server process is using jemalloc | |
# ref. [Japanese] https://tech.studyplus.co.jp/entry/2019/09/09/094140 | |
class AppController < ActionController::Base | |
def show | |
r = `strings /proc/#{Process.pid}/maps | grep jemalloc` | |
render plain: "<h1>#{ENV['LD_PRELOAD'].presence || 'empty'}</h1><pre>#{r}</pre>" | |
end | |
end |
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
# spin up our new (empty) database | |
docker compose up -d db_postgres_151 | |
# login to postgres | |
$ psql -U postgres | |
$ CREATE DATABASE database_name | |
# dump our existing database | |
docker compose exec -it db_postgres_146 /bin/bash -c 'pg_dumpall -U $POSTGRES_USER > /backup/20230127.sql' |
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
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
OlderNewer