Skip to content

Instantly share code, notes, and snippets.

@hakerdefo
hakerdefo / sources.list
Last active April 19, 2024 19:41
Ubuntu 22.04 LTS (Jammy Jellyfish) complete sources.list
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
@roommen
roommen / OpenSSH Update Script - Amazon Linux 2
Last active April 19, 2024 19:41
OpenSSH Update Script - Amazon Linux 2
#!/bin/bash
sudo yum install gcc -y
sudo yum install openssl-devel -y
sudo yum install zlib-devel -y
sudo yum install mlocate -y
sudo yum install autoconf -y
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
tar zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1 && ./configure && make && sudo make install
@vfontjr
vfontjr / user_role_add-remove.php
Last active April 19, 2024 19:41
Masterminds user role add/remove
<?php
/**
* masterminds_update_user_roles function.
*
* This is the main callback function for the
* frm_after_create_entry and frm_after_update_entry actions
* It's purpose is to process Developers Directory registrations
* and grant various WordPress roles based on user responses
*
* @access public
@enjalot
enjalot / index.html
Created September 8, 2011 15:15
Simple Pie Chart example with D3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
@maxux
maxux / humanread.c
Last active April 19, 2024 19:34
Human readable size to bytes in C
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include <string.h>
static char *human_readable_suffix = "kMGT";
size_t *parse_human_readable(char *input, size_t *target) {
char *endp = input;
@zer0k-z
zer0k-z / rampbugfix.md
Created April 3, 2024 23:27
CS2KZ's rampbug fix

Introduction

In CS2, when a player is sliding/surfing against some geometry, it's possible that they lose all their momentum/velocity. This is usually called wallbug/rampbug. While the name was inherited from Source 1 games (such as CS:GO, CS:S, TF2,...), rampbugs in CS2 behave much differently from its predecessor. In contrast to source 1 games, it's also possible have the velocity redirected to another direction instead of losing all momentum.

This bug doesn't seem to be common in all source 2 games (HL:A for instance, does not have this bug), and was orignially not present in the very early versions of CS2 Limited Test. Rampbugs become more and more frequent over time, with the Call to Arms update effectively doubling the frequency of these bugs, which is a significant problem for custom gamemodes heavily depending on geometry collision (eg. surf).

Keep in mind that while the player collision hitbox is a box, the images shown below will represent the player as a dot instead for simplicity.

Observati

@fevangelou
fevangelou / my.cnf
Last active April 19, 2024 19:32
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@ShaneMcRetro
ShaneMcRetro / capacitor_tier_list.md
Last active April 19, 2024 19:31 — forked from komidore64/capacitor_tier_list.md
Capacitor Tier List

Capacitor Tier List

First Tier (Japanese)

  • Rubycon
  • United Chemi-Con (or Nippon Chemi-Con)
  • Nichicon
  • Sanyo/Suncon
  • Panasonic
  • Hitachi
@tanyuan
tanyuan / smart-caps-lock.md
Last active April 19, 2024 19:30
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@jacksonpires
jacksonpires / create_locale_files.rb
Created May 26, 2023 21:37
Move pt-br.yml to splitted version
# frozen_string_literal: true
require "yaml"
namespace :dev do
desc "Create locale files to models"
task create_locale_files: :environment do
models_folder = Rails.root.join("app","models")
original_new_locales_folder = Rails.root.join("config", "locales")