Skip to content

Instantly share code, notes, and snippets.

View Nimdis's full-sized avatar

Sergei Toroshchin Nimdis

View GitHub Profile
@Nimdis
Nimdis / sh
Created May 28, 2023 11:24
ROCM AMD GPUs troubles fixing
# if you cannot install pytorch with
pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1
# just replace it with
pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm5.1.1
# don't forget to uninstall torch before installing ROCM version
pip uninstall torch torchvision
# if you get "Segmentation fault (core dumped)" just use
export HSA_OVERRIDE_GFX_VERSION=10.3.0
const isZiinaUser = (phoneNumber) => {
return false;
};
const contactsMap = new Map(); // key - useId, val -> set of phone numbers
const phoneToUserMap = new Map(); // key - phone number, val -> set of userIds
const syncContacts = (userId, phoneNumbers) => {
const prevPhoneNumbersSet = contactsMap.get(userId) ?? new Set();
const phoneNumbersSet = new Set(phoneNumbers);
@Nimdis
Nimdis / tabfix
Created July 6, 2016 11:56
This two commands replaced tabs in vim by spaces
set expandtab
retab
@Nimdis
Nimdis / strace.sh
Created April 27, 2016 06:45
strace example for tmux
strace -f -e trace=file tmux
add-apt-repository ppa:ondrej/php
apt update
apt install php5.6 libapache2-mod-php5.6 php5.6-curl php5.6-gd php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-xmlrpc
a2dismod php7.0
a2enmod php5.6
systemctl restart apache2
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to [DestinationIP:PORT]
@Nimdis
Nimdis / install_gitbucket.sh
Last active August 5, 2016 05:10
install gitbucket on ubuntu 16.04
apt-get update
apt-get install default-jre
adduser -m git
apt-get install wget unzip
su git
cd
wget http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.zip
unzip wildfly-10.0.0.Final.zip -d wildfly1
mv wildfly1/wildfly-10.0.0.Final wildfly
rm -R wildfly1
curl -XPUT "http://localhost:9200/prod_products/_settings" -d '{ "index": { "max_result_window" : 100000 } }'
@Nimdis
Nimdis / _readme.md
Created November 29, 2015 13:41 — forked from mislav/_readme.md
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@Nimdis
Nimdis / gist:c6f26f5eab50f27572a7
Created November 19, 2015 17:17
Arch installing
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Create partitions
gdisk /dev/sda
1 100MB EFI partition # Hex code ef00
2 250MB Boot partition # Hex code 8300
3 100% size partiton # Hex code 8300