Skip to content

Instantly share code, notes, and snippets.

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active November 24, 2024 07:03
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@liuran001
liuran001 / config.yaml
Last active November 24, 2024 07:03
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.12-241024
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@ychoi-kr
ychoi-kr / srt.py
Created November 5, 2023 09:37
whisper scripts
# modified script from https://github.com/openai/whisper/discussions/98#discussioncomment-3725983
from datetime import timedelta
import os
import sys
import whisper
def transcribe_audio(path):
model = whisper.load_model("large")
print("Whisper model loaded.")
@Fardeen786-eng
Fardeen786-eng / fas_datasets.csv
Last active November 24, 2024 06:58
List of face anti-spoofing datasets
Dataset Year #Live/Spoof #Sub. Setup Attack Types
NUAA 2010 5105/7509 (I) 15 N/R Print(flat, wrapped)
CASIA-MFSD 2012 150/450 (V) 50 7 scenarios and 3 image quality Print(flat, wrapped, cut), Replay(tablet)
REPLAY-ATTACK 2012 200/1000 (V) 50 Lighting and holding Print(flat), Replay(tablet, phone)
MSU-MFSD 2014 70/210 (V) 35 Indoor scenario; 2 types of cameras Print(flat), Replay(tablet, phone)
OULU-NPU 2017 720/2880 (V) 55 Lighting & background in 3 sections Print(flat), Replay(phone)
CelebA-Spoof 2020 156384/469153 (I) 10177 4 illumination conditions; indoor & outdoor; rich annotations Print(flat, wrapped), Replay(monitor, tablet, phone), Mask(paper)
@squarism
squarism / iterm2.md
Last active November 24, 2024 06:52
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@mlabonne
mlabonne / merge_peft.py
Last active November 24, 2024 06:50
Merge base model and peft adapter and push it to HF hub
# Example usage:
# python merge_peft.py --base_model=meta-llama/Llama-2-7b-hf --peft_model=./qlora-out --hub_id=alpaca-qlora
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import argparse
def get_args():
@narate
narate / create-hotspot.md
Last active November 24, 2024 06:47
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@en0ndev
en0ndev / get_windowsphotoviewer.md
Last active November 24, 2024 06:46
ENABLE/RESTORE WINDOWS PHOTO VIEWER IN WINDOWS 10/11
@markasoftware
markasoftware / enterprise_token.rb
Last active November 24, 2024 06:44
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
$edgeEnterpriseMSIUri = 'https://edgeupdates.microsoft.com/api/products?view=enterprise'
$response = Invoke-WebRequest -Uri $edgeEnterpriseMSIUri -Method Get -ContentType "application/json" -UseBasicParsing -ErrorVariable InvokeWebRequestError
$jsonObj = ConvertFrom-Json $([String]::new($response.Content))
$selectedIndex = [array]::indexof($jsonObj.Product, "Stable")
$LatestEdgeUrl = ($jsonObj[$selectedIndex].Releases |
Where-Object { $_.Architecture -eq "x64" -and $_.Platform -eq "Windows"} |