Skip to content

Instantly share code, notes, and snippets.

@divyashrestha
divyashrestha / install_localwp_for_ubuntu.md
Last active April 24, 2025 13:16
Install localwp for ubuntu

Download and install libtinfo5 package

curl -O http://launchpadlibrarian.net/648013231/libtinfo5_6.4-2_amd64.deb
sudo dpkg -i libtinfo5_6.4-2_amd64.deb

Download and install libncurses5 package

curl -O http://launchpadlibrarian.net/648013227/libncurses5_6.4-2_amd64.deb
@divyashrestha
divyashrestha / install_zsh_ubuntu.md
Last active April 24, 2025 13:25
Install ZSH on Ubuntu (Oh-my-zsh)

List of terminal commands to install the zsh.

# ZSH
sudo apt install zsh -y
sudo apt-get install powerline fonts-powerline -y
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh

# REBOOT
@divyashrestha
divyashrestha / phpmyadmin-in-docker.md
Last active May 15, 2024 08:47 — forked from poudelmadhav/phpmyadmin-in-docker.md
Run phpmyadmin in docker and connect to local mysql

Run phpmyadmin in docker

Find the ip address running this command:

ip addr show docker0 | grep inet

This will be the PMA_HOST in below steps. The PMA_HOST of local machine is like this: 172.17.0.1

Create a user

use this command to create a user for phpmyadmin login

@divyashrestha
divyashrestha / custom_filter.rb
Created January 4, 2024 06:31
Create custom filter with custom attribute.
```app/models/concerns/active_admin/filter_name.rb```
module ActiveAdmin::FilterName
extend ActiveSupport::Concern
included do
def self.ransackable_scopes(_auth_object = nil)
%i[attribute_eq]
end
def self.attribute_eq(paramater)
return none unless invalid_parameter
@divyashrestha
divyashrestha / stimulus.md
Created November 2, 2022 08:58 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@divyashrestha
divyashrestha / reset_mysql_password.md
Created October 31, 2022 06:46 — forked from poudelmadhav/reset_mysql_password.md
Reset mysql root password

Reset MySQL Root Password:

  • Stop MySQL
sudo service mysql stop
  • Make MySQL service directory.
sudo mkdir /var/run/mysqld
  • Give MySQL user permission to write to the service directory.
@divyashrestha
divyashrestha / deploy.sh
Created June 14, 2022 05:46 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@divyashrestha
divyashrestha / database.rules.json
Created December 23, 2021 05:14 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}