Skip to content

Instantly share code, notes, and snippets.

@tazjel
tazjel / installation.md
Created January 7, 2020 11:50 — forked from natbusa/installation.md
Dell XPS for Ubuntu 18.04

Dell XPS for Ubuntu 18.04

Bios:

press F12 on the Dell startup screen

  • disable safe boot
  • Change SATA Operation from "RAID On" to "AHCI"
  • Enable Legacy Boot as well as UEFI

Install Ubuntu from USB drive

Instructions are here: https://www.ubuntu.com/download/desktop

@tazjel
tazjel / installNeovim.sh
Created April 10, 2018 05:08 — forked from darcyparker/installNeovim.sh
Build and install neovim for Debian
#!/usr/bin/env bash
#Build and install neovim for Debian
#See: https://neovim.io/
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start
#Save current dir
pushd .
#Install dependencies
@tazjel
tazjel / index.html
Created January 5, 2018 16:40 — forked from titangene/index.html
Web × Arduino - Timeout (LED matrix)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Webduino Blockly Timeout Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script>
<script src="https://blockly.webduino.io/webduino-blockly.js"></script>
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script>
@tazjel
tazjel / letsencrypt_2017.md
Created November 27, 2017 18:53 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@tazjel
tazjel / node-and-npm-in-30-seconds.sh
Created November 6, 2017 03:28 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tazjel
tazjel / readme.md
Created October 23, 2017 23:06 — forked from endolith/readme.md
How to stream a webcam to a web browser in Ubuntu

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion

~> nano ~/.motion/motion.conf

@tazjel
tazjel / gist:fdb92d3d6e49ee78c10cca8f7738dae2
Created September 28, 2017 03:25
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@tazjel
tazjel / scraper.py
Created September 13, 2017 20:24 — forked from MarkDunne/scraper.py
Scraper for food hygiene dataset
import requests
import pandas as pd
from bs4 import BeautifulSoup
categories = {
'7846': 'Mobile caterer',
'7838': 'Farmers/growers',
'14': 'Importers/Exporters',
'7843': 'Pub/bar/nightclub',
'4613': 'Retailers - other',
@tazjel
tazjel / TrueColour.md
Created August 3, 2017 22:34 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@tazjel
tazjel / test.py
Created June 23, 2017 14:49 — forked from manuelep/test.py
web2py Openstreetmap implementation example
# -*- coding: utf-8 -*-
for url in [
'http://dev.openlayers.org/theme/default/style.css',
'http://dev.openlayers.org/examples/style.css',
'http://dev.openlayers.org/OpenLayers.js'
]:
response.files.append(url)
def map():