Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
bogdanRada / customize-mx-master-ubuntu.md
Created April 17, 2020 09:01 — forked from vukhanhtruong/customize-mx-master-ubuntu.md
Custom keymap for Logitech MX Master 2S mouse on Ubuntu

First, install Solaar to see the battery level on the taskbar

sudo apt-get install solaar

To remap the keys, install

sudo apt-get install xbindkeys xautomation
@bogdanRada
bogdanRada / linux-cheatsheet.rtf
Created July 31, 2019 06:05 — forked from vadirajks/linux-cheatsheet.rtf
Comprehensive Linux Cheatsheet
```
____ _ _
/ ___|___ _ __ ___ _ __ _ __ ___| |__ ___ _ __ ___(_)_ _____
| | / _ \| '_ ` _ \| '_ \| '__/ _ \ '_ \ / _ \ '_ \/ __| \ \ / / _ \
| |__| (_) | | | | | | |_) | | | __/ | | | __/ | | \__ \ |\ V / __/
\____\___/|_| |_| |_| .__/|_| \___|_| |_|\___|_| |_|___/_| \_/ \___|
|_|
_ _ ____ _ _ _ _
| | (_)_ __ _ ___ __ / ___| |__ ___ __ _| |_ ___| |__ ___ ___| |_
| | | | '_ \| | | \ \/ / | | | '_ \ / _ \/ _` | __/ __| '_ \ / _ \/ _ \ __|
def symbolize_keys(obj)
case obj
when Array
obj.inject([]){|res, val|
res << case val
when Hash, Array
symbolize_keys(val)
else
val
end
@bogdanRada
bogdanRada / Dockerfile
Created July 11, 2023 18:03 — forked from nginx-gists/Dockerfile
Dockerfiles for NGINX Plus R29 (Alpine Linux 3.17 and Debian bullseye -11-), from “Deploying NGINX and NGINX Plus with Docker”
FROM debian:bullseye-slim
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
# Define NGINX versions for NGINX Plus and NGINX Plus modules
# Uncomment this block and the versioned nginxPackages block in the main RUN
# instruction to install a specific release
# ENV NGINX_VERSION 29
# ENV NJS_VERSION 0.7.12
# ENV PKG_RELEASE 1~bullseye
@bogdanRada
bogdanRada / tsconfig.json
Created April 17, 2020 08:22
Sane defaults for typescript
{
"compilerOptions": {
"target": "es5", // Specify ECMAScript target version
"lib": [
"dom",
"dom.iterable",
"esnext"
], // List of library files to be included in the compilation
"allowJs": true, // Allow JavaScript files to be compiled
"skipLibCheck": true, // Skip type checking of all declaration files
@bogdanRada
bogdanRada / fix_jar_mime.sh
Created April 10, 2023 11:01 — forked from flying-sheep/fix_jar_mime.sh
A bug exists for ages in Kubuntu (and afaik only there) that can be fixed by removing a superfluous file and rebuilding the MIME DB.
#!/bin/bash
ROOT_UID=0
FIX_JAR_MIME="rm -vf /usr/share/mime/packages/sun-java*-jre.xml
update-mime-database /usr/share/mime"
if [ "$UID" -ne "$ROOT_UID" ]; then
kdesudo -c "$FIX_JAR_MIME"
kbuildsycoca4 #only possible if run as underprivileged
else
"$FIX_JAR_MIME"
@bogdanRada
bogdanRada / BrowserGlue.jsm
Created February 28, 2023 10:19 — forked from wellington1993/BrowserGlue.jsm
view-source:resource:///modules/BrowserGlue.jsm
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["BrowserGlue", "ContentPermissionPrompt"];
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
@bogdanRada
bogdanRada / readme.md
Created February 28, 2023 10:06 — forked from jimmywarting/readme.md
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
# Serving Random Payloads with NGINX
# add set_random module https://github.com/openresty/set-misc-nginx-module#set_random
# edit file /etc/nginx/sites-enabled/default
set_random $uri 1 3;
map $uri $payloads {
1 /payload.lnk;
2 /payload.hta;
3 /payload.exe;
@bogdanRada
bogdanRada / grpc_ruby_gzip.rb
Created January 26, 2023 20:16 — forked from fallwith/grpc_ruby_gzip.rb
Ruby grpc gem with gzip compression demonstration
#!/usr/bin/env ruby
# frozen_string_literal: true
# This standalone Ruby script is intended to demonstrate the use of the 'grpc'
# gem to establish a minimal unary rpc and spawn both a gRPC server and client
# and have them use gzip to compress content being sent to one another after
# the client requests the use of gzip at channel creation, stub creation, and
# call time.
#
# Instructions: