Skip to content

Instantly share code, notes, and snippets.

@syntaxhacker
syntaxhacker / Flutterinstallwithoutandroidstudio.md
Last active April 30, 2024 02:49
setup flutter without android studio

Flutter install without android studio

set flutter

Download flutter

tar xvf flutter_linux_1.17.5-stable.tar.xz

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@nileshsimaria
nileshsimaria / docker-default-directory
Last active April 4, 2024 09:13
Change docker's default /var/lib/docker to different directory on Ubuntu
1. Take a backup of docker.service file.
$ cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
2. Modify /lib/systemd/system/docker.service to tell docker to use our own directory
instead of default /var/lib/docker. In this example, I am using /p/var/lib/docker
Apply below patch.
$ diff -uP -N /lib/systemd/system/docker.service.orig /lib/systemd/system/docker.service
--- /lib/systemd/system/docker.service.orig 2018-12-05 21:24:20.544852391 -0800
@CSRaghunandan
CSRaghunandan / nginx.conf
Last active April 20, 2024 19:47
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
@krmgns
krmgns / Element.prototype.classList.js
Last active October 28, 2020 01:25
Polyfill: Element.prototype.classList for IE8/9, Safari.
/**
* Element.prototype.classList for IE8/9, Safari.
* @author Kerem Güneş <k-gun@mail.com>
* @copyright Released under the MIT License <https://opensource.org/licenses/MIT>
* @version 1.2
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
*/
;(function() {
// Helpers.
var trim = function(s) {
@jherax
jherax / is-private-mode.js
Last active March 19, 2024 18:29
Detect if the browser is running in Private mode - Promise based (last update: Feb 2020)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@sebastianwebber
sebastianwebber / README.md
Last active February 19, 2024 11:44
Compilation of the Uber Facts on PostgreSQL to MySQL Migration

Uber facts

Original posts/information

Key points

  • ~50GB MySQL Application
  • Main motivation: PostGis
  • Migration made with a custom tool(xml2pgcopy) and mysqldump on 45min
@htp
htp / curl-websocket.sh
Last active April 25, 2024 14:57
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/