https://tuxamito.com/wiki/index.php/Installing_newer_GCC_versions_in_Ubuntu
Switching between compiler versions:
sudo update-alternatives --config gcc
| package main | |
| import ( | |
| "log" | |
| "runtime" | |
| ) | |
| // PrintMemUsage __ | |
| func PrintMemUsage() { | |
| var m runtime.MemStats |
| func generateCreateTableQueryByModel(t interface{}) string { | |
| var queryBuilder strings.Builder | |
| queryBuilder.WriteString("CREATE TABLE IF NOT EXISTS ") | |
| val := reflect.TypeOf(t) | |
| queryBuilder.WriteString(fmt.Sprintf("%s (", strings.ToLower(val.Name()))) | |
| n := val.Field(0).Name | |
| tp := val.Field(0).Type.String() | |
| queryBuilder.WriteString(fmt.Sprintf("%s %s PRIMARY KEY,", strings.ToLower(n), sqliteTypesMap[tp])) | |
| for i := 1; i < val.NumField(); i++ { | |
| n = val.Field(i).Name |
| // Serialize dumps object to byte array via gob encoder | |
| func Serialize(obj interface{}) ([]byte, error) { | |
| buf := &bytes.Buffer{} | |
| enc := gob.NewEncoder(buf) | |
| err := enc.Encode(obj) | |
| if err != nil { | |
| return nil, err | |
| } | |
| return buf.Bytes(), nil | |
| } |
| # deb cdrom:[Ubuntu 19.10 _Eoan Ermine_ - Release amd64 (20191017)]/ eoan main restricted | |
| # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
| # newer versions of the distribution. | |
| deb http://id.archive.ubuntu.com/ubuntu/ eoan main restricted | |
| # deb-src http://id.archive.ubuntu.com/ubuntu/ eoan main restricted | |
| ## Major bug fix updates produced after the final release of the | |
| ## distribution. | |
| deb http://id.archive.ubuntu.com/ubuntu/ eoan-updates main restricted |
| #deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted | |
| # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
| # newer versions of the distribution. | |
| deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
| # deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
| ## Major bug fix updates produced after the final release of the | |
| ## distribution. | |
| deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted |
| import ( | |
| "io" | |
| "os" | |
| "bytes" | |
| ) | |
| // DumpBytesToFile writes byte array to the file | |
| func DumpBytesToFile(inp []byte, path string) error { | |
| f, err := os.Create(path) | |
| if err != nil { |
| package main | |
| import ( | |
| "context" | |
| "net/http" | |
| "log" | |
| "time" | |
| ) | |
| func getDbHelper() <-chan bool { |
https://tuxamito.com/wiki/index.php/Installing_newer_GCC_versions_in_Ubuntu
Switching between compiler versions:
sudo update-alternatives --config gcc
Install wine:
https://wiki.winehq.org/Ubuntu
Create game folder and copy installer there:
mkdir ./heroes_wine
mkdir ./heroes_wine/heroes
cp /home/user/Downloads/HotA_1.6.1_setup.exe /home/user/Documents/heroes_wine
| import os | |
| import re | |
| import sys | |
| import shutil | |
| import argparse | |
| from tqdm import tqdm | |
| parser = argparse.ArgumentParser(description='') | |
| parser.add_argument("--path", type=str, required=False, default="./data") |