Skip to content

Instantly share code, notes, and snippets.

@il-katta
il-katta / install.sh
Last active July 23, 2023 17:35
install bitsandbytes on Archlinux
git clone https://github.com/timdettmers/bitsandbytes.git
cd bitsandbytes
export LD_LIBRARY_PATH=/opt/cuda/lib/
CUDA_VERSION=122 make cuda12x CUDA_HOME=/opt/cuda/
pip install .
@il-katta
il-katta / install_bitcoin-core_centos.sh
Last active October 11, 2021 19:21
install bitcoin-core ( with gui ) on Centos Stream ( or Centos 8 )
#!/bin/bash
set -xe
# db4
sudo dnf install -y gcc-c++ autoconf make patch
wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/install_db4.sh
sudo mkdir -p /usr/src/db4
sudo chown $(whoami) /usr/src/db4
bash install_db4.sh /usr/src/db4
@il-katta
il-katta / Dockerfile
Last active January 30, 2022 02:43
script to update katta/openwrt-rootfs docker image
ARG VERSION=latest
FROM docker.io/katta/openwrt-rootfs:$VERSION
RUN mkdir -p /var/lock \
&& mkdir -p /var/run \
&& opkg update \
&& opkg install \
luci \
luci-ssl \
rem run with: DiskPart /s diskpart_create_single.txt
rem == diskpart_create_single.txt ==
select disk 1
clean
rem convert mbr
convert gpt
create partition primary
rem active
format quick fs=ntfs label="W2G"
assign letter="W"
@echo off
rem maybe this software is needed: https://www.microsoft.com/en-us/download/details.aspx?id=48595
rem set WindowsISO=%cd%\%1
set WindowsISO="%cd%\Windows10.iso"
shift
ECHO create partitions
DiskPart /s diskpart_create_single.txt
rem se il file install.wim non è già stato estratto
IF NOT EXIST "%CD%\install.wim" (
#The following command will set $Disk to all USB drives with >20 GB of storage
#$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }
$Disk = Get-Disk
#Clear the disk. This will delete any data on the disk. (and will fail if the disk is not yet initialized. If that happens, simply continue with ‘New-Partition…) Validate that this is the correct disk that you want to completely erase.
#
# To skip the confirmation prompt, append –confirm:$False
Clear-Disk –InputObject $Disk[1] -RemoveData
[Unit]
Description = Virtualbox VM
After = systemd-user-sessions.service network.target sound.target
ConditionPathExists = /dev/tty0
[Service]
Type = simple
TTYPath = /dev/tty8
StandardInput = tty
StandardOutput = tty
#!/bin/bash
# author: Andrea Cattaneo
# check raspberry pi cpu temperature with perfdata and warn/crit thresholds
#
# check raspberry pi temperature with perfdata and warn/crit thresholds.
# The data is read from sysfs ( file: /sys/class/thermal/thermal_zone0/temp ).
#
# Dependency: awk bc
# licence: GPL
if [ -z "$1" ] ; then
@il-katta
il-katta / web.runme.sh.conf
Created March 28, 2015 11:18
nginx configuration for php apps
# this configuration is absolutely not safe!!
server {
listen 80;
server_name *.localdomain;
access_log /var/log/nginx/users.access.log;
error_log /var/log/nginx/users.error.log info;
#autoindex on;
RDS_JSON_MOD_VERSION=0.13
DRIZZLE_MOD_VERSION=0.1.7
MODSECURITY_VERSION=2.8.0
SET_MISC_MOD_VERSION=0.26
NGX_DEVEL_KIT_VERSION=0.2.19
FORM_INPUT_VERSION=0.10
NAXSI_VERSION=0.53-2
sudo apt-get -y install dpkg-dev
sudo apt-get build-dep nginx