Skip to content

Instantly share code, notes, and snippets.

@c22dev
c22dev / DEPSteps.md
Last active May 3, 2024 11:36
Remove MDM & DEP from an Apple Sillicon Mac (Sonoma)

How to make an MDM Mac shine like it's brand new ?

Works, as of 14/04/2024, on macOS 14.4.1 and lower (prob higher but idk)

This was made for Apple Sillicon Macs.

Restore Process

You need another Mac for this.

If you don't have one and have recovery locked, it's not possible.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@Artefact2
Artefact2 / README.md
Last active May 3, 2024 11:33
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

  • Disable git hooks
git config core.hooksPath no-hooks
  • Re-enable git hooks
git config --unset core.hooksPath
@sigridjineth
sigridjineth / tcopl_deepmind.md
Created February 11, 2024 02:29
Training Compute-Optimal Large Language Models - DeepMind

2편: ‘모델 크기’와 ‘학습 토큰 수’의 적절한 비율은? | NeurIPS 2022 | 김택민

2편: ‘모델 크기’와 ‘학습 토큰 수’의 적절한 비율은? | NeurIPS 2022 | 김택민

Gopher만큼 계산량이 있다면 63B → 1.4T에서 학습하는 것이 최적이라고 한다. 실제 현업에서는 관점 2가 조금 더 현실성이 있는데, pretrain을 하기 전에 이미 GPU를 사용했으므로 계산량이 고정되어 있는 상태. 최고의 정확도를 내기 위해서 모델 크기를 어떻게 조정해야 하는지 그래프를 통해서 결론을 낼 수 있을 것이다. 안드레 카파시도 nanoGPT에서 관점 2를 좋아한다고 언급했다.

Figure 3 > Figure 2 더 이해하기 편하다.

관점 1과 관점 2에서 얻은 데이터를 조금 더 잘 해석하는 방향으로 제안하는 것인데, 우리가 데이터 포인트를 400개 모았는데 최종 로스를 예측할 수 있는 모델을 만들면 어떨까? 라는 생각이고 샘 알트만도 내부 인터뷰를 통해서 최초 학습 조금 하면 최종 로스를 알 수 있다는 내용 말했음. 로스 예측 모델을 잘 이야기하면 모델 크기는 얼마나 되어야 하고 데이터셋은 얼마나 필요한지 잘 예측할 수 있을 것이다. GPU 스케줄링이 쉬워진다던지, 이 사람에게 몇 대를 빌려주면 되는지 등 잘 빌려주는 것이 좋을 수 있다. 저자들은 로스 예측 모델을 저렇게 생길 수 있지 않을까? 이야기했고. L-BFGS 알고리즘을 이용해서 Huber 로스를 최소화하는 방향으로 학습하면 파라미터를 채울 수 있다고 한다.

@Andrey2G
Andrey2G / encoding.txt
Last active May 3, 2024 11:26
Video Encoding with multiple resolutions
ffmpeg -i "c:/videos/sample.mp4
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v libx264 -crf 22 -c:a aac -ar 48000
-filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k
-filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k
-filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p"
-preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3
-hls_flags independent_segments -master_pl_name "name-pl.m3u8"
"c:/videos/encoded/name-%v.m3u8"

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 3, 2024 11:24
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@wd5gnr
wd5gnr / cdfunc.sh
Last active May 3, 2024 11:21
cdfunc.sh
# This function defines a 'cd' replacement function capable of keeping,
# displaying and accessing history of visited directories, up to 10 entries.
# To use it, uncomment it, source this file and try 'cd --'.
# acd_func 1.0.5, 10-nov-2004
# Petar Marinov, http:/geocities.com/h2428, this is public domain
xcd_func ()
{
local x2 the_new_dir adir index
@Valian
Valian / app.html.heex
Created May 2, 2024 17:34
Phoenix LiveView teleport hook
<.flash_group flash={@flash} />
<main>
<%= @inner_content %>
</main>
<%!-- We're doing teleport because navigation is rendered in root layout which is not updated --%>
<%!-- Notice "hidden" class, it's important because we're not really teleporting content, but duplicating it --%>
<div :if={@current_user} id="onboarding-render" phx-hook="teleport" data-teleport-target="onboarding" class="hidden">
<MyApp.Onboarding.onboarding current_user={@current_user} />