Skip to content

Instantly share code, notes, and snippets.

@MaxXSoft
MaxXSoft / Dockerfile
Created November 27, 2022 09:40
A fun tool for generating an x86-64 Linux program that runs in reverse order.
FROM ubuntu:20.04
RUN apt update && DEBIAN_FRONTEND="noninteractive" apt install -y \
python3 build-essential
WORKDIR /root
@jjromannet
jjromannet / gist:9a5ee7e480801576b68af1ed5fd8e979
Created November 10, 2021 07:44
Dockercompose config tu run MySQL 5.7 that works
version: "3.9"
services:
db:
image: mysql/mysql-server:5.7
environment:
MYSQL_DATABASE: 'db'
MYSQL_ROOT_PASSWORD: 'secret-pw'
MYSQL_ROOT_HOST: '%'
ports:
- '3306:3306'
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
data:
redis.conf: |
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
@iximiuz
iximiuz / net_lab_broadcast_domains.sh
Last active January 13, 2024 22:17
A bunch of helper functions to create Linux bridges, network namespaces, and interconnect everything using veth pairs.
#!/usr/bin/env bash
set -xeuo pipefail
create_bridge() {
local nsname="$1"
local ifname="$2"
echo "Creating bridge ${nsname}/${ifname}"
@gramcha
gramcha / having-multiple-jdk-macos.md
Created November 28, 2020 14:34
Managing multiple Java versions in MacOS

Installing different versions of open jdk through Homebrew(assuming already installed) and already having Java 8.

We need to install a tool called jenv - Java version manager which is similar to nvm(nodeJs version manager).

brew install jenv

Export the jenv path to .bash_profile or .zshrc - whatever you are using. I am using .zshrc

@osamaqarem
osamaqarem / nginx_macos.md
Last active March 28, 2024 18:37
Nginx on MacOS

Install nginx (Homebrew)

brew install nginx

Configuration file for nginx will be at /usr/local/etc/nginx/nginx.conf

Web apps can be stored at /usr/local/var/www

Commands

Start:

@matey-jack
matey-jack / dl-list-mini.fs
Last active March 14, 2024 11:49 — forked from anonymous/dllist.rs
Simple doubly-linked list in safe Rust
//! A doubly-linked list in 50 LOCs of stable and safe Rust.
// Backup-fork of https://play.rust-lang.org/?gist=c3db81ec94bf231b721ef483f58deb35
use std::cell::RefCell;
use std::rc::{Rc, Weak};
use std::fmt::Display;
// The node type stores the data and two pointers.
//
// It uses Option to represent nullability in safe Rust. It has zero overhead
// over a null pointer due to the NonZero optimization.
@bartosjiri
bartosjiri / manjaro-broadcom-wlan-fix.md
Last active February 18, 2023 10:33
Manjaro broadcom WLAN fix

Manjaro broadcom WLAN fix

Problem

Manjaro installation doesn't offer any WLAN connections.

Solution

  1. Connect the device to the internet through ethernet, phone-to-USB or other available method.

  2. Uninstall current drivers:

@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@gexiangdong
gexiangdong / README.md
Last active September 21, 2023 02:11
在非spring项目中使用slf4j和logback

在 spring-boot 项目中, slf4j和logback被自动引入,只需要配置logback即可使用,当不是spring-boot项目时,需要我们手工做点事才能使用。

增加依赖

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>