Skip to content

Instantly share code, notes, and snippets.

View zubaer-ahammed's full-sized avatar
🏠
Working from home

Md. Zubaer Ahammed zubaer-ahammed

🏠
Working from home
View GitHub Profile
Change mysql root password: sudo dpkg-reconfigure mysql-server-5.5
// Note: To check mysql version: mysql -V
xcopy J:\*.* /s/e/f H:
// Note: Generally you can't copy files or folder from a CD or DVD which is protected. But with this windows command you can copy all files and folders from one drive or folder or cd to another derive or folder or pendrive
@zubaer-ahammed
zubaer-ahammed / RunScheduler.php
Last active December 21, 2020 09:23 — forked from robbydooo/RunScheduler.php
Heroku Laravel Scheduler - Overcoming Heroku Scheduler's 10 minute minimum interval limit
<?php
/**
* This Scheduler will run once every minute unlike the Heroku scheduler which only runs every 10 mintues.
* To use this scheduler with Laravel 5.4+ add this file to /app/Console/Commands/RunScheduler.php
* Register this file in app/Console/Kernel.php
* protected $commands = [
* ...
@zubaer-ahammed
zubaer-ahammed / Frequently Needed SSH Commands.md
Last active January 19, 2024 14:47
Frequently Needed SSH Commands ( Mostly Linux & Mac + PUTTY for windows)

Useful SSH Commands:

  1. first command: sudo whoami
  2. Create a file named "testfile": touch testfile
  3. make a directory named "testdir": mkdir testdir
  4. list or show all files and folders in a dir: ls
    • For showing hidden files also run this command with a flag: ls -a
  5. change directory: cd
  6. back on directory: cd ..
  7. go to the root directory: cd ~
@zubaer-ahammed
zubaer-ahammed / Open Remote File in Sublime Text.md
Last active April 25, 2024 09:45
Open Remote File in Sublime Text (Linux Server) - Tested with Ubuntu

Open Remote File in Sublime Text:

I felt the importance of directly editing a file from a DigitalOcean droplet on my Ubuntu Server. I research on the internet and made a way to do it.

Local Machine Settings:

  1. Install "rsub" in your Sublime Text.
    • Hit Ctrl+Shift+P, start typing “install” and select “Install Package”
    • Start typing “rsub” and select it.
@zubaer-ahammed
zubaer-ahammed / Reset MySQL Root Password in Mac OS.md
Last active June 7, 2024 22:50
Reset MySQL Root Password in Mac OS

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
@zubaer-ahammed
zubaer-ahammed / delete-orphans-usermeta.sql
Created March 2, 2018 19:24 — forked from carlosleopoldo/delete-orphans-usermeta.sql
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
@zubaer-ahammed
zubaer-ahammed / flex frequently used classes.css
Created March 8, 2018 14:39
Frequently used flex css classes
.flex {
display: flex;
display: -webkit-flex;
display: -moz-flex;
}
.flex-row {
flex-direction: row;
}
  1. Status in current branch: git status
  2. Show all remotes: git remote
  3. Check to see if you are up to date with the current branch: git fetch
  4. Switch to a different branch within current remote: git checkout branch_name (Example: git checkout master or git checkout zubaer)
  5. Switch to a different branch within a different remote: git branch -u remote_name/branch_name (Example: git branch -u production/master or git branch -u origin/master). It is important to provide -u. Otherwise, it will try to create a new Branch.
  6. Create a new Branch: git branch branch_name (Example: git branch zubaer).
  7. Show commit history: git log
  8. Git add all: git add .
  9. Git commit: git commit -m 'Commit text'
  10. Push to a branch: git push remote_name branch_name (Example: git push production master or git push origin master)
@zubaer-ahammed
zubaer-ahammed / woocommerce-select2-selectwoo-remove
Last active November 2, 2020 15:51 — forked from ontiuk/woocommerce-select2-selectwoo-remove
Woocommerce Remove Select2 / SelectWoo
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting
/**
* Remove Woocommerce Select2 - Pre WC 3.2.1-ish
*/
function woo_dequeue_select2() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );