Skip to content

Instantly share code, notes, and snippets.

View TheMasterR's full-sized avatar
🏠
Working from home

Lucian Pantea TheMasterR

🏠
Working from home
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 16, 2024 15:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@denji
denji / nginx-tuning.md
Last active July 17, 2024 13:48
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active May 26, 2024 17:26
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active July 12, 2024 09:40
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@adajw
adajw / 00-main.sh
Last active September 16, 2021 08:14
Arch Linux
# script order:
# install.sh
# configure.sh
# harden.sh
# iptables.sh
# grub.sh
# TODO security:
# - grsec configure
# - sudo & root hardening
@FlorianHeigl
FlorianHeigl / cheatsheets.md
Last active June 21, 2024 02:41
Printable Cheat Sheets for Software

A collection of links to useful cheat sheets.

Only what's properly printable can get a spot at the top of this list. It should also be small enough to fit on a few pages. almost all links in this document were designed by their creators so that YOU can print them in a good-looking format and store them however is best for you. Anything that isn't really something you could print in A4/UfS Letter format, but is still a well-made cheatsheet can get a spot at the end of the page.

Pleae contribute any you remember you've seen and liked. It would be wonderful if we can get these to be something more commonly made.

Search Engines

@pythoninthegrass
pythoninthegrass / osx_sanity_check.sh
Last active September 12, 2020 15:17
Mac Setup
#!/usr/bin/env bash
# SOURCES:
# https://gist.github.com/DylanTackoor/7a04052cfc3a726d9af6f798875189fc
# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Exit upon failed command
# set -e
@kvaps
kvaps / kubernetes-as-proxmox-container.md
Last active September 29, 2022 14:33
Run Kubernetes as Proxmox container

Add to your contaier config /etc/pve/lxc/XXX.conf:

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop: 
lxc.mount.auto: proc:rw sys:rw

@polonskiy
polonskiy / encrypted-git-repo.md
Created February 7, 2018 12:13
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@msojda
msojda / index.js
Created April 3, 2018 09:18
Giphy chat bot
const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;
const bodyParser = require("body-parser");
const fetch = require("node-fetch");
app.use(bodyParser.json());
app.get("/", (req, res) => {
res.send("Hello World");
});