Skip to content

Instantly share code, notes, and snippets.

@odan
odan / php-oracle.md
Last active November 13, 2020 20:03
XAMPP - Oracle Driver Setup (v12)
@Jiab77
Jiab77 / nvidia-elementaryos-loki.md
Last active February 28, 2024 00:28
nVidia drivers installation on ElementaryOS - Loki (ubuntu 16.04 based distrib)

nVidia drivers installation on ElementaryOS - Loki

Introduction

ElementaryOS - Loki is an amazing ubuntu based distribution, I've just felt in love on it BUT they've removed what's required to install easily the nVidia Proprietary drivers. So here is the reason of this gist, to store the install instructions in one place inside a crystal clear documentation.

Check your device

@clemlatz
clemlatz / self-signed-ssl-certificate.md
Last active April 22, 2024 12:30
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
@therightstuff
therightstuff / _end-to-end-enc.js.md
Last active December 19, 2023 02:17
Javascript / Node.js end-to-end encryption
@tennox
tennox / elementary-fish-task-completion-notification.fish
Last active October 3, 2019 23:39
Elementary OS Loki Task complete notification for fish shell
# ! install xdotool first - it is needed to check if the terminal is in foreground (or disable that if you don't want)
# then append this to ~/.config/fish/config.fish (create it if not existent)
function alert_cmd_done --on-event fish_postexec
set status_code $status # save for later
set active_window (ps -p (xdotool getwindowpid (xdotool getactivewindow)) -o comm=) # get the process name of the currently active window
if status --is-interactive # Check for interactive session (keyboard attached)
if [ $active_window != "pantheon-termin" -a \
$CMD_DURATION -a \
$CMD_DURATION -gt (math "1000 * 5") ] # in background, after a job longer than 5 seconds
@ChrisTimperley
ChrisTimperley / install-docker-elementary-loki.sh
Last active April 27, 2020 19:44
Installs Docker on Elementary OS 0.4 (Loki)
#!/bin/bash
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo rm -f /etc/apt/sources.list.d/docker.list
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -u -cs) \
stable"
sudo apt-get update
sudo apt-get purge lxc-docker
@devmatheus
devmatheus / console.php
Created August 25, 2016 19:50
Generate entity from table - Laravel 5.3
<?php
#path routes/console.php
Artisan::command('entity:generate', function () {
$modelName = $this->ask('Model Name');
$tableName = $this->ask('Table Name');
$fs = new Illuminate\Filesystem\Filesystem();
$pdo = DB::getPdo();
$ds = DIRECTORY_SEPARATOR;
@vitorbritto
vitorbritto / makefile
Created July 6, 2016 12:47
Using makefile to run automated tasks
# MAKEFILE
#
# Autor: Vitor Britto
# Versão: 0.1.0
#
#
# Descrição:
# Arquivo para gerar um estrutura inicial para
# novos projetos e realizar tarefas de automação
#
@chris-jamieson
chris-jamieson / setup.md
Created April 19, 2016 15:43
Set up Franz for Ubuntu
  • Download Franz for your distribution from MeetFranz.com
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz
  • (optional) wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franz
  • (optional) sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]
Name=Franz
Comment=
@981746
981746 / example.html
Created March 16, 2016 06:12 — forked from schmuli/example.html
A simple AngularJS service for handling the 'onbeforeunload' event
<!DOCTYPE html>
<html data-ng-app="TestApp">
<head>
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<script>
angular.module('TestApp', [])
.factory('beforeUnload', function ($rootScope, $window) {
// Events are broadcast outside the Scope Lifecycle