Skip to content

Instantly share code, notes, and snippets.

@xomachine
xomachine / mkmultibootusb.sh
Created October 8, 2016 18:26
The script for making your usb flash drive bootable with linux isos without lossing data.
#!/bin/bash
set -e
show_help () {
cat <<EOF
The script for making multiboot linux live flashes.
Arguments:
-b <path> set path to the boot directory on the flash drive
-i <path to drive> install loader to the suplied flash drive
-a <path to iso> add iso to multiboot flash
-h show this help message

Инструкция по работе с базой данных перевода на компьютере

0. Назначение инструкции

Данная инструкция предназначена для обучения обслуживанию репозитория. Это НЕ инструкция по переводу. Под обслуживанием репозитория подразумевается:

  • сборка мода
  • обновление английских текстов в репозитории согласно текущей версии игры
  • исправление переводов после обновления
  • извлечение переведённых текстов из мода

Для перевода используется специальный web-интерфейс: https://sbt-community.github.io/

@xomachine
xomachine / nvidia_switch.sh
Last active April 15, 2019 16:52
A little script for starting X server on GPU used for passthrough by default
#!/bin/bash
if [ x"$DISPLAY" != x ]; then
SUDO="lxsudo"
else
SUDO="sudo"
fi
if [ $UID = 0 ]; then
from parseopt import getopt, cmdArgument, cmdShortOption
from strutils import `%`
from algorithm import sorted
from streams import newFileStream, Stream, setPosition,
getPosition, close, write, readStr,
readChar, atEnd, newStringStream
import layout
type
NumberedObject = object
@xomachine
xomachine / hdbm.nim
Created June 5, 2017 13:47
Little utility to show rtdb fields of NWChem calculation.
from nesm import serializable
from streams import Stream, atEnd
from tables import Table, initTable, `[]`, `[]=`
const cookie* = "hdbm v1.0"
serializable:
type
FileEntry* = object
key_size: int32
val_size: int32
This file has been truncated, but you can view the full file.
argument 1 = ch4_zts.nw
============================== echo of input deck ==============================
# This run never really converges well because the two H's that are doing
# all the real work pop off to form H2 and do a little dance and then
# come back to the CH2 group they left behind. Optimizing the details of
# the little dance is about as likely has finding blinker fluid
# at the auto parts store
This file has been truncated, but you can view the full file.
argument 1 = ch4_zts.nw
============================== echo of input deck ==============================
# This run never really converges well because the two H's that are doing
# all the real work pop off to form H2 and do a little dance and then
# come back to the CH2 group they left behind. Optimizing the details of
# the little dance is about as likely has finding blinker fluid
# at the auto parts store
@xomachine
xomachine / ActionType.nim
Created November 12, 2017 16:33
Buggy example
type ActionType* = enum
NONE = 0
CLEAR_AND_SELECT = 1
ADD_TO_SELECTION = 2
DESELECT = 3
ASSIGN = 4
DISMISS = 5
DISBAND = 6
MOVE = 7
ROTATE = 8
diff --git a/tools/Makefile b/tools/Makefile
index 2242203..b3f94b6 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -15,7 +15,7 @@ clean:
$(RM) -r $(SRCDIR)/nimcache $(SIGSEARCH) $(DLLPARSER)
$(SIGSEARCH):
- $(NIMC) c $(ADDITIONALARGS) -o:$(SIGSEARCH) $(SRCDIR)/sigsearch.nim
+ $(NIMC) --listCmd c $(ADDITIONALARGS) -o:$(SIGSEARCH) $(SRCDIR)/sigsearch.nim
diff -d -r -u -p nimcache/spcounter.c nimcache_b4ef/spcounter.c
--- nimcache/spcounter.c 2018-02-05 12:21:01.000000000 +0300
+++ nimcache_b4ef/spcounter.c 2018-02-05 20:09:00.705877000 +0300
@@ -3,7 +3,7 @@
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
- gcc -c -w -DPACKAGE -I/usr/lib/nim -o /tmp/yaourt-tmp-john/aur-steamforwarder-git/src/SteamForwarder/tools/nimcache/spcounter.o /tmp/yaourt-tmp-john/aur-steamforwarder-git/src/SteamForwarder/tools/nimcache/spcounter.c */
+ gcc -c -w -DPACKAGE -I/usr/lib/nim -o /home/xomachine/.Soft/builds/aur/steamforwarder-git/src/SteamForwarder/tools/nimcache/spcounter.o /home/xomachine/.Soft/builds/aur/steamforwarder-git/src/SteamForwarder/tools/nimcache/spcounter.c */
#define NIM_NEW_MANGLING_RULES