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 / Apache_Multiple_PHP_Versions_Setup:on_macOS_High_Sierra.md
Last active March 4, 2023 08:21
MacOS 10.13 High Sierra Apache Setup: Multiple PHP Versions

Warning: Due to Homebrew/php tap being deprecated at the end of March 2018, and the moving of all PHP formulas to Homebrew/core, the installation of PHP versions we currently use is going to change. Currently PHP 7.2 is available in the core, but we are waiting on previous versions to be made available and will update this guide as soon as we can. Thanks!

Part 1: macOS 10.13 High Sierra Web Development Environment

Note: This is an updated version of our prior OS X development series. The newly released macOS 10.13 High Sierra and the accompanying updates to Brew require significant changes compared to prior releases, necessitating a thorough revamp in the process. Since 10.12 we now use Homebrew's Apache, rather than the built-in version, but this new appraoch is more flexible and should continue to work on prior OS X versions.

Developing web applications on macOS is a real joy. There are plenty of options for setting up your develop

@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 / 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 / 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 / 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 / ffmpeg_mkv_mp4_conversion.md
Last active December 24, 2018 11:08 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@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