$ ssh-keygen
cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
#!/usr/bin/env python | |
"""Script that I keep in a Git repository along with my dotfiles. In the | |
repository, the files don't have the dot prefix so I can see them more easily. | |
Running the script symlinks all the files to ~/.<filename>, checking allowing | |
you to cancel if the file exists. | |
""" | |
import os | |
import glob |
import urllib2 | |
import mimetypes | |
from django.conf import settings | |
from django.db import models | |
from django.contrib.auth.models import User | |
class Category(models.Model): | |
name = models.CharField(max_length=32) | |
class Meta: |
"use strict"; | |
// Load plugins | |
const autoprefixer = require("autoprefixer"); | |
const browsersync = require("browser-sync").create(); | |
const cp = require("child_process"); | |
const cssnano = require("cssnano"); | |
const del = require("del"); | |
const eslint = require("gulp-eslint"); | |
const gulp = require("gulp"); |
#update | |
sudo apt update && sudo apt -y upgrade | |
#install apache | |
sudo apt install -y apache2 | |
#Install php | |
sudo apt-get install -y php libapache2-mod-php | |
#install mysql | |
sudo apt install -y mysql-server | |
sudo mysql_secure_installation | |
sudo mysql -u root -p |
sudo curl -s https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer | |
#The install command (composer require symfony/symfony) | |
#The current version (3.2.4) | |
#Create a directory on your server for this project: | |
sudo mkdir /var/www/html/symfony-test | |
cd /var/www/html/symfony-test | |
sudo vim composer.json |
DROP TRIGGER IF EXISTS upd_user;
DELIMITER $$
CREATE TRIGGER upd_user BEFORE UPDATE ON `user`
FOR EACH ROW BEGIN
IF (NEW.password IS NULL OR NEW.password = '') THEN
SET NEW.password = OLD.password;
ELSE
SET NEW.password = Password(NEW.Password);
import axios from "axios"; | |
const baseURL = process.env.API_URL | |
? process.env.API_URL | |
: "http://127.0.0.1:8000/api/v1/"; | |
const axiosInstance = axios.create({ | |
baseURL: baseURL, | |
timeout: 5000, | |
headers: { |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |