Skip to content

Instantly share code, notes, and snippets.

@stamate
stamate / ccnt.py
Last active November 30, 2023 16:39
ccnt
#!/usr/bin/env python3
import os
def write_file(file_name, content):
with open(file_name, 'w') as file:
file.write(content)
def main():
os.makedirs('container')
@stamate
stamate / killer_wifi.hook
Created April 22, 2020 09:07
Archlinux pacman hook for ath10 QCA6174 wifi killer card (Dell XPS 13 9370)
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = linux
Target = linux-lts
[Action]
Description = Updating kernel WIFI with proprietary drivers...
When = PostTransaction
@stamate
stamate / updatewifi.sh
Created April 8, 2020 12:27
Update wifi drivers for ath10 QCA6174 on Archlinux for Dell XPS 13 9370
#!/bin/zsh
FOLDER='/tmp/ath10k-firmware-master/QCA6174'
wget --directory-prefix=/tmp --no-check-certificate --content-disposition https://codeload.github.com/kvalo/ath10k-firmware/zip/master
unzip /tmp/ath10k-firmware-master.zip 'ath10k-firmware-master/QCA6174/*' -d /tmp
mv $FOLDER//hw3.0/firmware-4.bin_* $FOLDER/hw3.0/firmware-4.bin
sudo rm -rf /lib/firmware/ath10k/QCA6174
sudo mv $FOLDER /lib/firmware/ath10k/
@stamate
stamate / tochrome.sh
Created April 8, 2020 12:24
Search for selected / highlighted text in new google chrome tab
xclip -out -selection primary | sed 's/.*/"? &"/' | xargs google-chrome-stable
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
fi
@stamate
stamate / .tmux.conf
Last active June 1, 2020 12:06
tmux conf
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# enable putty
set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E[%p1%d q:Csr=\E[2 q,screen*:XT,*256col*:colors=256"
## Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R