Skip to content

Instantly share code, notes, and snippets.

View filipeandre's full-sized avatar

Filipe Ferreira filipeandre

  • 14:22 (UTC +01:00)
View GitHub Profile
@filipeandre
filipeandre / convert_utf8_general_ci.sql
Last active April 17, 2018 13:09
Convert all tables to utf8_general_ci
SELECT
CONCAT( 'ALTER TABLE `', TABLE_NAME, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) AS 'Copy & run these SQL statements:'
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = "database_name"
AND TABLE_COLLATION != "utf8_general_ci"
AND TABLE_TYPE = "BASE TABLE";
@filipeandre
filipeandre / gotranslate.go
Created April 20, 2018 19:01
Simple script used to translate laravel lang file
package main
import (
"fmt"
"io"
"log"
"os"
"regexp"
"bufio"
"bytes"
@filipeandre
filipeandre / translations.go
Created April 20, 2018 19:04
Simple script to replace inline blade translations with keys and create the translation file based on $t function passed from controler
package main
import (
"os"
"io"
"regexp"
"path/filepath"
"bufio"
"strings"
"bytes"
@filipeandre
filipeandre / publish.bat
Created April 21, 2018 16:39
Publish a .net core application to linux
dotnet publish . -c Release --runtime ubuntu.16.04-x64
@filipeandre
filipeandre / daemon.json
Last active May 2, 2018 11:32
Docker log file configuration
{
"storage-driver": "overlay2",
"graph": "/var/lib/docker",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "2"
},
"debug": false,
"userns-remap": "1000:1000"
@filipeandre
filipeandre / smb.conf
Created May 7, 2018 14:48
In order to access windows 10 shares set max samba protocol to 3
[global]
client max protocol = SMB3
@filipeandre
filipeandre / fstab
Last active May 8, 2018 16:48
Some useful linux mount configs
# Ram mounts
tmpfs /tmp tmpfs nodev,nosuid,size=1G 0 0
tmpfs /home/xooxx/.cache/google-chrome/Default tmpfs nodev,nosuid,size=1G 0 0
tmpfs /home/xooxx/.cache/mozilla/firefox/6xh5l5hs.default tmpfs nodev,nosuid,size=1G 0 0
# Ntfs windows drives
UUID=F4789A76789A3778 /mnt/WD10EFRX ntfs windows_names,hide_hid_files,nosuid,nodev,permissions,defaults 0 0
UUID=C0D680E5D680DD52 /mnt/MK1059GMS ntfs windows_names,hide_hid_files,nosuid,nodev,permissions,defaults 0 0
@filipeandre
filipeandre / codecs.sh
Created May 7, 2018 22:57
Install restricted codecs
sudo apt install ubuntu-restricted-extras
@filipeandre
filipeandre / reset_permissions.sh
Last active May 8, 2018 14:16
Reset file and folder permissions to the user default
sudo chmod -R a+rwX,o-w .
sudo chown $USER:$USER .
@filipeandre
filipeandre / systemd.service
Created May 8, 2018 14:54
Restart service on failure
#/lib/systemd/system
Restart=on-failure
RestartSec=5s