Skip to content

Instantly share code, notes, and snippets.

View izshreyansh's full-sized avatar
💭
Writing code doesn't bug me, I'm the one that BUG the code.

Shreyansh Panchal izshreyansh

💭
Writing code doesn't bug me, I'm the one that BUG the code.
View GitHub Profile
@izshreyansh
izshreyansh / init.sh
Created February 2, 2020 13:48
Initialize new sql for lamp stack
sudo apt-get update -y
sudo apt-get upgrade -y
cd ~
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sysctl vm.swappiness=10
sudo sysctl vm.vfs_cache_pressure=50
Just do this: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair
Here is what I did, thanks to Eric Hammond's blog post:
Stop the running EC2 instance
Detach its /dev/xvda1 volume (let's call it volume A) - see here
Start new t1.micro EC2 instance, using my new key pair. Make sure you create it in the same subnet, otherwise you will have to terminate the instance and create it again. - see here
Attach volume A to the new micro instance, as /dev/xvdf (or /dev/sdf)
SSH to the new micro instance and mount volume A to /mnt/tmp
@izshreyansh
izshreyansh / code.md
Created September 11, 2019 14:11
Laravel Test Mail
Mail::send('errors.500', [], function($message) 
{
  $message->to('[email protected]')->subject('Testing mails');
});
@izshreyansh
izshreyansh / .bash_aliases
Last active February 29, 2020 05:38
Important bash commands for prod
alias ..="cd .."
alias ...="cd ../.."
alias h='cd ~'
alias c='clear'
alias art=artisan
alias codecept='vendor/bin/codecept'
alias phpspec='vendor/bin/phpspec'
alias phpunit='vendor/bin/phpunit'
@izshreyansh
izshreyansh / README
Last active August 12, 2019 14:17
Laravel Deployment Checklist
# laravel-deployment
- [ ] Install apache
- `sudo systemctl start apache2`: Manage apache [stop,status,restart,reload,disable,enable]
- [Install apache](https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04)
- `sudo a2enmod rewrite` enable mod rewrite
- `<Directory /var/www/domain.com/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All