Skip to content

Instantly share code, notes, and snippets.

View punyaruchal's full-sized avatar
🏠
Working from home

Punya Ruchal punyaruchal

🏠
Working from home
View GitHub Profile
@punyaruchal
punyaruchal / drupal-7-8-password-reset.md
Created August 24, 2021 11:06
Drupal 7 and 8 admin password reset

Reset Drupal admin password

  • Log into Mysql or login using PhpMyadmin and go to your respective database
  • Find the users_field_data table
  • Find the user that is related to you.
  • Log into your terminal
  • Go to your Drupal projct main directory
  • Run this command
php core/scripts/password-hash.sh “NewPasswordHere”
@punyaruchal
punyaruchal / ssh-and-its-inside-file-permission.md
Created May 25, 2021 13:03
.SSH and its inside files permission

.SSH and its inside files permission

To change .ssh and its files user and group

chown -R your_user:your_user .ssh

Folder and file permission ss for rights, go with 700 for .ssh and 600 for authorized_keys and other files.

chmod 700 .ssh 
@punyaruchal
punyaruchal / bash-history-search -partial-up-and-down-arrow.md
Last active May 25, 2021 13:00
Bash history search, partial + up and down arrow

Bash history search, partial + up and down arrow

Open your ~/.inputrc. If you don't have this file, see the end for how to create it. Add these lines:

## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward

Lines starting with # are comments. I can't remember what is backward and what forward. Experiment with it. Maybe you have to switch backward and forward.

@punyaruchal
punyaruchal / git-bash-aliases-functions.md
Created May 25, 2021 12:46
Git Bash Aliases and Functions

Git Command-Line Shortcuts

A lot of my time is spent in Terminal and a majority of it is spent typing Git commands. I created a set of keyboard shortcuts with Bash aliases and functions to speed up my workflow and save me hundreds of keystrokes every day.

Git Bash Aliases and Functions

Git allows you to set aliases but they’re limited and only save you a few keystrokes (i.e. instead of git checkout you can type git co, but you still have to type git). Since Bash is Terminal’s default command-line interpreter, you can also set Bash aliases to reduce your keystrokes even further.

Here’s my list of Git Bash aliases and functions. To use them as your own, just add them to the file you store your aliases/functions. (i.e. ~/.bash_profile or ~/.bashrc)

@punyaruchal
punyaruchal / linux-terminal-commands.md
Created May 25, 2021 12:14
Useful terminal commands and shortcuts (Linux::Ubuntu)

Useful terminal commands and shortcuts (Linux::Ubuntu)

Commands

  • sudo apt-get install <pkg name> install package
  • sudo apt-get remove <pkg name> remove package
  • apt list | grep <txt to search> search currently installed packages
  • xkill kill an unresponsive window w. mouse
  • touch to create file, mkdir to create dir
  • rm to delete file, rmdir to delete dir
@punyaruchal
punyaruchal / ubuntu-Bash-home-directory-windows10.md
Last active May 25, 2021 12:15
Ubuntu Bash Home directory in Windows 10

Ubuntu Bash shell home directory in Windows 10 (and Your Windows System Drive in Bash)

C:\Users\punya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\punya

Copy the code line into run address bar

%userprofile%\AppData\Local\Packages\
@punyaruchal
punyaruchal / cloudSettings
Created January 18, 2019 09:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-18T09:19:56.862Z","extensionVersion":"v3.2.4"}
@punyaruchal
punyaruchal / installing-drush-on-your-mac.md
Last active July 12, 2018 11:34
Installing Drush specific version on your mac

Download and unpack Drush in a local folder

  • /Users/myusername/drush
(I like to keep my apps together, so I put my drush directory in /Users/myusername/drush)
  • get drush from here: GitHub repo

https://github.com/drush-ops/drush

ID name email firstname lastname Status roles Password
1 rakesh rakesh.james@gmail.com Rakesh James 1 administrator,migrationuser rakesh@123
2 james james.rakesh@gmail.com James Rakesh 1 authenticated james@123
3 dummy dummy@gmail.com Dummy User 1 migrationuser,administrator dummy@123
id: User_with_multiple_roles
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: null
label: 'User migration from CSV test'
source:
plugin: csv
path: /Users/rakeshjames/Sites/migrationdemo/csv/demouser_migrate_multipleRoles.csv