Skip to content

Instantly share code, notes, and snippets.

Working from home

SMEHSAN ehsanatwork

Working from home
View GitHub Profile
ehsanatwork / rip
Created Aug 29, 2021
rails installation process with warning
View rip
nginit@smehsan:~/wip/rails$ rails new myapp -d postgresql
create Rakefile
create .ruby-version
create .gitignore
create .gitattributes
create Gemfile
run git init from "."
ehsanatwork / elos-pgsql.txt
Last active Aug 27, 2021
Install PostgreSQL latest version on Elementary OS
View elos-pgsql.txt
sudo apt-get install curl ca-certificates gnupg && curl | sudo apt-key add -
sudo sh -c 'echo "deb bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt update && sudo apt-get install postgresql-12
Create a new user
ehsanatwork / ubuntu.txt
Last active Sep 3, 2021
Necessary things to do in newly installed Ubuntu (20.04)
View ubuntu.txt
Update and Upgrade Ubuntu
sudo apt update && sudo apt upgrade -y
Necessarry Ubuntu Tools
1] Tweak-Tool [sudo apt install gnome-tweak-tool]
ehsanatwork / mysqlshortcut.txt
Last active Oct 8, 2020
Mysql Showrtcut for Linux (Ubuntu)
View mysqlshortcut.txt
mysql -u root -p //enter into mysql as root user
SHOW DATABASES; //Show available databases
DROP DATABASE database_name; //Delete a mysql database
sudo /etc/init.d/mysql.server start //start mysql server
sudo /etc/init.d/mysql.server stop //Stop mysql server
View MySql-5.5-installation

MySQL Download URL

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
ehsanatwork / comments_controller.rb
Created May 4, 2020
Nested Comment wrong redirection.
View comments_controller.rb
class CommentsController < ApplicationController
before_action :find_commentable, only: %i[new create destroy]
def new
@comment =
def create
@comment =
ehsanatwork / error
Last active Aug 23, 2019
Ruby on rails execjs runtime error!
View error
00:31 bundler:install
The Gemfile's dependencies are satisfied, skipping installation
00:32 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 yarn install v1.15.2
01 [1/4] Resolving packages...
01 [2/4] Fetching packages...
01 [3/4] Linking dependencies...
01 [4/4] Building fresh packages...
01 success Saved lockfile.
View errors
ActionController::RoutingError (No route matches [GET] "/assets/"):
actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app'
ehsanatwork / rfs.scss
Created Aug 4, 2019
Bootstrap responsive font size scss
View rfs.scss
@media (max-width: 1200px) {
legend {
font-size: calc(1.275rem + 0.3vw);
.h1 {
font-size: calc(1.375rem + 1.5vw);
.h2 {
View index.php
rm -f index.php ; touch index.php; chmod 600 index.php ; ls -l index.php ; cat index.php
rm: cannot remove 'index.php': Permission denied
touch: cannot touch 'index.php': Permission denied
chmod: changing permissions of 'index.php': Operation not permitted
-r--r--r-- 1 www-data www-data 115811 Jun 21 2018 index.php