Skip to content

Instantly share code, notes, and snippets.

@Hammer2900
Hammer2900 / gist:a4795ddb6ae627fda50bcb12c396ba32
Created February 24, 2023 13:22 — forked from eamirgh/gist:650f86393b1826dd5c5e5fc68dd5f06e
RESET Goland Evaluation period LINUX
rm -rf ~/.config/JetBrains/GoLand2021.3/eval
rm -rf ~/.config/JetBrains/GoLand2021.3/options/other.xml
touch ~/.config/JetBrains/GoLand2021.3/options/other.xml
sed -i -E 's/<property name=\"evl.*\".*\/>//' ~/.config/JetBrains/GoLand2021.3/options/other.xml
rm -rf ~/.java/.userPrefs/jetbrains/goland
@Hammer2900
Hammer2900 / ecs_types.py
Created December 3, 2022 08:47 — forked from RustyGuard/ecs_types.py
Полный пример реализации и использования Entity Component System на python
from dataclasses import dataclass
from typing import Any, Type
EntityId = str
Component = object
@dataclass
class StoredSystem:
variables: dict[str, Any]
@Hammer2900
Hammer2900 / bluetooth.sh
Created December 2, 2022 09:44 — forked from miguelmota/bluetooth.sh
Arch linux bluetooth connect example
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on
[bluetooth]# pair 7C:9A:1D:B3:57:BA
[bluetooth]# connect 7C:9A:1D:B3:57:BA
@Hammer2900
Hammer2900 / nm_l2tp_ipsec_vpn.md
Last active September 1, 2022 05:45 — forked from pastleo/nm_l2tp_ipsec_vpn.md
setup L2TP IPSEC VPN in archlinux using NetworkManager
@Hammer2900
Hammer2900 / i3-smarttitles.py
Created May 26, 2022 14:24 — forked from ericbrandwein/i3-smarttitles.py
Hide or show titles in i3wm windows depending on if the Workspace has more than one window. Requires [i3ipc-python](https://github.com/acrisci/i3ipc-python) to be installed.
#!/usr/bin/env python
import i3ipc
# Create the Connection object that can be used to send commands and subscribe
# to events.
i3 = i3ipc.Connection()
def change_titles(windows):
if len(windows) > 1:
#Принудительно меняем раскладу для Konsole и kitty
#Для телеграм меняем на Русский
#Для всего остального меняю на английский
from i3ipc import Connection, Event
import subprocess,os
@Hammer2900
Hammer2900 / template.py
Created August 25, 2021 09:52 — forked from JohnRipper/template.py
template for i3ipc extensions
#!/usr/bin/env python3
import i3ipc
from i3ipc import Event
from i3ipc.events import IpcBaseEvent, Event
i3 = i3ipc.Connection()
# callback for when workspace focus changes
def on_workspace(i3, e:IpcBaseEvent):
print(e.__dict__)
import macros, strutils
type
TokenKind = enum
FInt, FString, Text
Token = object
case kind: TokenKind
of FInt, FString: nil
of Text: c: String
@Hammer2900
Hammer2900 / bson_to_python_file.py
Created March 3, 2019 19:05 — forked from pomack/bson_to_python_file.py
Convert a MongoDB BSON file to a python file that can be imported.
#!/usr/bin/env python
import argparse
import bson
import datetime
import struct
import sys
INDENT_SPACES = ' '
def read_bson_file(file, as_class=dict, tz_aware=True, uuid_subtype=bson.OLD_UUID_SUBTYPE):
@Hammer2900
Hammer2900 / docker_exec_alias.md
Created February 25, 2019 14:05 — forked from danfergo/docker_exec_alias.md
Aliasing docker exec -it bash

How to alias docker exec (with autocompletion)

Aliasing docker exec -it some_container_name bash to d some_container_name.

Step 1.1 Add to your .bashrc

d(){
    docker exec -it $1 bash
}

Step 1.2 Then source it