Quantcast
Channel: Recent Gists from caiokawasaki
Browsing latest articles
Browse All 18 View Live

Install a new locale on Ubuntu

new-locale.sh # Show all available locales locale -a # Generate a new locale locale-gen pt_BR.UTF-8 # reconfigures packages after they have already been installed dpkg-reconfigure locales # Updates...

View Article



default-vue-server-block

default-vue-server-block server { listen 80; listen [::]:80; root /var/www/html/site.com.br/dist; index index.html; server_name site.com.br www.site.com.br; location / { try_files $uri $uri/...

View Article

Change default ssh root directory

ssh-root-directory.sh #On linux server nano ~/.bashrc cd /var/www/html #On Mac nano .bash_profile

View Article

nginx-root-server-block

nginx-root-server-block server { listen 80; server_name IP_ADDRESS; return 301 http://YOUR.DOMAIN; }

View Article

Laravel folders permissions

laravel-permissions.sh sudo chgrp -R www-data storage bootstrap/cache sudo chmod -R ug+rwx storage bootstrap/cache

View Article


Create new user in MySql

new-mysql-user.sh mysql -u root -p new-mysql-user.sql CREATE USER 'sites'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'sites'@'localhost'; FLUSH PRIVILEGES;

View Article

bus.js

bus.js import Vue from 'vue' const bus = new Vue() //Install the Event Bus in the Vue.prototype when imported export default function install(Vue) { Object.defineProperty(Vue.prototype, '$bus', {...

View Article

main.js

main.js import Vue from 'vue' import App from './app' //Defines the global Event Bus in the Vue.prototype Vue.prototype.$bus = new Vue() new Vue({ router, store, render: h => h(App) }).$mount('#app')

View Article


main.js

main.js import Vue from 'vue' import bus from './support/bus' Vue.use(bus) new Vue({ router, store, render: h => h(App) }).$mount('#app')

View Article


bus.js

bus.js import Vue from 'vue' export default new Vue()

View Article

component.vue

component.vue <template> ... </template> <script> import Bus from '../support/bus' export default { mounted() { Bus.$emit('mounted') } } </script> <style scoped> ......

View Article

component.vue

component.vue <template> ... </template> <script> import Bus from '../support/bus' export default { mounted() { Bus.$on('mounted') }, destroyed() { Bus.$off('mounted') } }...

View Article

Install all necessary resources for a Laravel server

initial-lemp.sh apt update apt install vsftpd curl -s https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -...

View Article


Default Laravel Nginx server block

default-laravel server { listen 80; server_name rilo.com.br www.rilo.com.br; root /var/www/html/rilo.com.br/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1;...

View Article

Default Vue Nginx server block

default-vue server { listen 80; listen [::]:80; root /var/www/html/inveniocenter.rilo.com.br/dist; index index.html; server_name inveniocenter.rilo.com.br; location / { try_files $uri $uri/ @rewrites;...

View Article


laravel_supervisor.config

laravel_supervisor.config[program:laravel_worker]process_name=%(program_name)s_%(process_num)02dcommand=php /var/www/html/app.com/artisan queue:work database --sleep=5...

View Article

supervisor.sh

supervisor.shpip install supervisorecho_supervisord_conf > /etc/supervisord.conf#Copy the file to Website root#https://gist.github.com/caiokawasaki/2907ac9eed680fe6ad8de68553f18f87nano...

View Article


ssh_access.php

ssh_access.php<?phpuse phpseclib\Net\SSH2;use phpseclib\Crypt\RSA;$ssh = newSSH2('ip');$key = newRSA();$key->loadKey(file_get_contents('/.ssh/id_rsa'));$ssh->login('root',...

View Article
Browsing latest articles
Browse All 18 View Live




Latest Images