Skip to content

Instantly share code, notes, and snippets.

View Aries0d0f's full-sized avatar
🐈

Aries Cs Aries0d0f

🐈
View GitHub Profile
@munrocket
munrocket / wgsl_2d_sdf.md
Last active June 4, 2024 09:46
WGSL 2D SDF Primitives

WGSL 2D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/398

Circle - exact

fn sdCircle(p: vec2f, r: f32) -> f32 {
  return length(p) - r;
}
@munrocket
munrocket / wgsl_3d_sdf.md
Last active July 25, 2024 19:13
WGSL 3D SDF Primitives

WGSL 3D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/407

Sphere - exact

fn sdSphere(p: vec3f, r: f32) -> f32 {
  return length(p) - r;
}
@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active July 2, 2024 05:23
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@mattn
mattn / README.md
Last active February 8, 2024 04:58
blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist、master/slave という単語は相応しくないという意見に OSS がどの様に対応すべきかを自身で考える為の情報集めです。見つけ次第、逐次更新していきます。

僕(mattn) 自身は black lives matter に同意をしています。blacklist/whitelist、master/slave という単語を廃止する事が、歴史的背景を持たない文化圏では特定の意味を持たなかった為、個人的には若干思う所はありますが、廃止自身に反対するつもりはありません。

昔から、主副を表す物には master/slave という単語が使われてきました。ハードディスクの IDE、仮想端末(pty)、色々あります。またネットワークの IP フィルタリングに関しては blacklist/whitelist と表記した物が今でも沢山あります。

我々日本人が意識せずに使っていた blacklist/whitelist、master/slave という単語が、人々にどの様に影響しうるのか、今後 OSS としてどの様に関わっていけば良いかを理解する上で、自分なりの情報集めをしたいと思っています。

#sudo lastb -ai | head -n-2 | awk '{print$NF}' | awk '/[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+/{print}' | sort -t. -k1,1n -k2,2n -k3,3n -k4,4n | uniq --count | awk '$1>9{print$2}' > failed.ip.9
sudo lastb -ai | head -n-2 | awk '{print$NF}' | awk '/[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+/{print}' | sort | uniq --count | awk '$1>9{print$2}' > failed.ip.9
for ip in $(cat failed.ip.9); do
sudo firewall-cmd --permanent --zone=public --add-rich-rule="rule family='ipv4' source address='$ip' reject"
done
sudo firewall-cmd --reload
@MarkZhangTW
MarkZhangTW / curl.time.sh
Last active April 10, 2020 06:03
Curl format for displaying time infomation.
#!/usr/bin/env bash
# Reference: https://stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl
curl_format="\
%{time_namelookup}:\
%{time_connect}:%{time_appconnect}:\
%{time_pretransfer}:%{time_redirect}:\
%{time_starttransfer}:%{time_total}"
curl_result=$(echo "$curl_format" | curl -s -o /dev/null -w @- $@)
IFS=':' read -r -a array <<< "$curl_result"
@srstsavage
srstsavage / nginx_google_analytics
Last active June 6, 2023 22:50
google analytics in nginx
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
@suntong
suntong / go_io-read_packages.md
Last active July 20, 2022 09:32
[go-nuts] Differences between os, io, ioutils, bufio, bytes (with Buffer type) packages for file reading

http://grokbase.com/t/gg/golang-nuts/142spmv4fe/go-nuts-differences-between-os-io-ioutils-bufio-bytes-with-buffer-type-packages-for-file-reading

I'm quite confused as there seems to be multiple redundant ways to solve my problem (read a file, parse the content, serve it via http). Most people on stackoverflow would use bufio, but I just can't get the differences between this package and the Buffer type of bytes and just reading a file with the os methods. Also I don't know when and why I should choose those ways to do it, when I have the simple, but non-versatile, ioutils.ReadFile.

@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active July 25, 2024 08:41
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line