Skip to content

Instantly share code, notes, and snippets.

View victorbalssa's full-sized avatar

Victor Balssa victorbalssa

  • 18:26 (UTC -04:00)
View GitHub Profile
# --- One liner: MySQL Dump with docker --- #
$ /usr/bin/docker exec -it `your container name` /usr/bin/mysqldump -u `mysql user` --password=`mysql password` `mysql database` > backup.sql
# --- #
# --- One liner: MariaDB SQL Dump with docker --- #
$ /usr/bin/docker exec `your container name` /usr/bin/mariadb-dump -u `mariadb user` --password=`mariadb password` `mariadb database` > mariadb_backup.sql
@linuswillner
linuswillner / install-neofetch-motd.sh
Created February 9, 2020 15:31
Add neofetch display to system login scripts
#!/bin/bash
sudo apt install neofetch
sudo cp motd.sh /etc/profile.d/motd.sh
sudo chmod +x /etc/profile.d/motd.sh
@OleksiyRudenko
OleksiyRudenko / why-newline.md
Last active July 19, 2024 10:53
Why should text files end with a newline?

Why should text files end with a newline?

Reasons:

  • UNIX standard
  • If the last line in a file doesn't end with a newline then addition of next line affects two lines instead of one. This also pollutes diff on multiple files, so reader may wonder what has changed in a line whereas no significant change has occured.

Multiple newlines at the file end are also redundant as well as spaces at the end of line.

@superjose
superjose / .gitlab-ci.yml
Last active February 19, 2024 10:22
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@jonsamp
jonsamp / localhost-ssl.sh
Created June 11, 2017 21:16
Create https key and cert on localhost
cd ~/
mkdir .localhost-ssl
sudo openssl genrsa -out ~/.localhost-ssl/localhost.key 2048
sudo openssl req -new -x509 -key ~/.localhost-ssl/localhost.key -out ~/.localhost-ssl/localhost.crt -days 3650 -subj /CN=localhost
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.localhost-ssl/localhost.crt
npm install -g http-server
echo "
function https-server() {
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE