Skip to content

Instantly share code, notes, and snippets.

@yunpengn
yunpengn / README.md
Last active May 20, 2024 06:57
A step-by-step guide to install PostgreSQL on Ubuntu without sudo privilege

Install PostgreSQL on Ubuntu without sudo

Being the most advanced open-source relational database, many of us need to install PostgreSQL for some purposes. However, sometimes you may not have sudo privilege on an Ubuntu server. Then, how should you install PostgreSQL in this case?

Compile from source!

Next, we will show a step-by-step guide on how to install PostgreSQL on Ubuntu by compiling it from source.

PostgreSQL Compilation & Installation

@ammario
ammario / ipint.go
Last active May 20, 2024 06:57
Golang IP <-> int conversion
func ip2int(ip net.IP) uint32 {
if len(ip) == 16 {
return binary.BigEndian.Uint32(ip[12:16])
}
return binary.BigEndian.Uint32(ip)
}
func int2ip(nn uint32) net.IP {
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, nn)
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@aanari
aanari / set-alacritty-default.sh
Last active May 20, 2024 06:54
Set Alacritty as Default Terminal Editor (Ubuntu)
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator $(which alacritty) 50
sudo update-alternatives --config x-terminal-emulator
@OrionReed
OrionReed / dom3d.js
Last active May 20, 2024 06:51
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@thushan
thushan / ConvertAzureAppSettingsToLocalSettings
Created May 20, 2024 05:53
Azure App Settings to local.settings.json converter
<#
Azure App Settings / Environment Variables to local.settings.json Converter
| v1.0.0 |-----------------------------------------------------------------
This script will take an Azure App Settings JSON file and convert it to a
local.settings.json file for use with Azure Functions.
It also moves some of the Azure specific settings to the top of the file.
@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active May 20, 2024 06:50
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@ibrahimMumtaz
ibrahimMumtaz / Enterprise Security Architecture Note.md
Created May 15, 2024 17:25 — forked from BalajiAnbil/Enterprise Security Architecture Note.md
Generated from Enterprise Security Architecture.pdf Automatically

1. The Meaning of Security

1.1. The Cultural Legacy: Business Prevention

  • Security has a bad reputation for getting in the way of real business
  • This reputation has developed because of the way security professionals have practised
  • We need an accurate definition of what we mean by ‘security’
  • A technical definition of security may not be helpful
  • Security can be defined only relative to the value and risk propositions of the business

1.2. Measuring and Prioritising Business Risk

  • Risk is a combination of asset value, business impact, threat and vulnerability
  • Risk management is a combination of risk assessment and ‘risk mitigation’
@frfahim
frfahim / install virtualenv ubuntu 16.04.md
Last active May 20, 2024 06:45
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@zcroll
zcroll / JetBrains products Activation code until december 13 2024
Last active May 20, 2024 06:45
JetBrains products Activation code until december 13 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25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