Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
@Ruzzz
Ruzzz / gnupg_directory_permissions.sh
Last active February 1, 2023 23:36
gnupg directory permissions
chmod 700 ~/.gnupg
chmod 600 ~/.gnupg/*
find ~/.gnupg -type f -exec chmod 600 {}
find ~/.gnupg -type d -exec chmod 700 {}
@Ruzzz
Ruzzz / simple_parser.cpp
Created November 16, 2012 19:47
C++ Simple Parser
template <class T, class CharType>class Parser
{
Parser(T &t) :: m_curr(t.begin()) , m_end(t.end()) {}
bool next_char(CharType *c) {
bool not_eof = m_curr != m_end;
if (not_eof) {
*c = *m_curr;
m_curr++;
}
@Ruzzz
Ruzzz / oem_logon_background.bat
Created November 16, 2012 19:02
Windows OEM Logon Background Enable
REM run as admin, picture must be JPEG, picture size must be not more than 256KB
REM SET img_path=%1 or SET img_path="path to jpg" or
SET img_path=%~dp0background.jpg
SET bg_path=%SystemRoot%\system32\oobe\info\backgrounds
MD %bg_path%
COPY %img_path% %bg_path%\BackgroundDefault.jpg
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" /v OEMBackground /t REG_DWORD /d 1 /f
REM Shadow of controls: 0 - transparent shadow, 1 - shadow, 2 - no shadow
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v ButtonSet /t REG_DWORD /d 1 /f
@Ruzzz
Ruzzz / andrd_emltr_root.bat
Last active November 25, 2021 01:01
Root for Android SDK Emulator
:: Contact: ruzzzua@gmail.com
:: Version: 2015.08.17
:: Dependencies: Android Debug Bridge (adb)
@echo off
set path="c:\Program Files\Android\android-sdk\platform-tools\";%path%
set abi=arm
:: adb remount
:: adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
@Ruzzz
Ruzzz / build-python.md
Last active October 14, 2021 21:30
Build Python on Ubuntu

Python-3.7.0 - Ubuntu ??

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libbz2-dev libdb5.3-dev libexpat1-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev tcl-dev tk-dev zlib1g-dev tk openssl

cd /opt
sudo curl -sL https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz | sudo tar xJ

cd Python-3.7.0
@Ruzzz
Ruzzz / dockerfile-entrypoint-cmd.md
Last active March 25, 2021 16:31
Dockerfile ENTRYPOINT + CMD
  • Shell form: exec param
  • Exec form: ["exec", "param"]
No ENTRYPOINT ENTRYPOINT e0 p0 ENTRYPOINT ["e0", "p0"]
No CMD error /bin sh -c e0 p0 e0 p0
CMD ["e1", "p1"] e1 p1 /bin sh -c e0 p0 e0 p0 e1 p1
CMD ["p1", "p2"] p1 p2 /bin sh -c e0 p0 e0 p0 p1 p2
CMD e1 p1 /bin sh -c e1 p1 /bin sh -c e0 p0 e0 p0 /bin sh -c e1 p1
@Ruzzz
Ruzzz / ssh_directory_permissions.sh
Last active September 28, 2020 11:48
ssh directory permissions
chmod 700 ~/.ssh
chmod 644 ~/.ssh/*
chmod 600 ~/.ssh/id_rsa
@Ruzzz
Ruzzz / postgres_11_hints.md
Last active February 24, 2020 17:45
postgres 11 hints

Pre-installation cleanup

dpkg -l | grep postgres
sudo apt-get purge postgresql*  # or
sudo apt-get --purge remove postgresql\*

sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
IDE Date IDE MSVC++ cl.exe _MSC_VER .NET
VS 97 1997-02 5.0 5.0 1100
VS 6.0 1998-06 6.0 6.0 12.00 1200
VS .NET 2002 2002-02-13 7.0 7.0 13.00 1300 1.0
VS .NET 2003 2003-04-24 7.1 7.1 13.10 1310 1.1
VS 2005 2005-11-07 8.0 8.0 14.00 1400 2.0
VS 2008 2007-11-19 9.0 9.0 15.00 1500 2.0 – 3.5
VS 2010 2010-04-12 10.0 10.0 16.00 1600 2.0 – 4.0
VS 2012 2012-08-15 11.0 11.0 17.00 1700 2.0 – 4.5
# On remote host do:
# ------------------
# Add user
sudo adduser <USER> sudo
# Or:
sudo adduser <USER>
sudo usermod -a -G sudo <USER>
# Change ssh configuration