Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
@salaros
salaros / ubuntu-tweak.sh
Last active January 19, 2020 19:40
My tweaks for Ubuntu + Dell Inspiron 5567
#!/usr/bin/env bash
# Require root to run
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 0
fi
# [PlayOnLinux] - disables protection against the usage of Ptrace
# https://www.playonlinux.com/en/topic-10534-Regarding_ptrace_scope_fatal_error.html
@salaros
salaros / adobe-photoshop-winetricks.sh
Created October 14, 2018 20:18
Wine tricks recipe for Adobe Photoshop CC 2018
WINEARCH=win64 WINEPREFIX=$HOME/.PlayOnLinux/wineprefix/Photoshop/ winetricks \
atmlib flash \
corefonts gdiplus \
msxml3 msxml6 \
mfc42 vcrun2005 vcrun2008 vcrun2010 vcrun2012 vcrun2013 \
d3dx9 d3dcompiler_43 quartz \
devenum \
vsm=3 \
fontsmooth=gray \
ddr=opengl \
Install-Module VSSetup -Scope CurrentUser
@salaros
salaros / adblock-filter-urls.txt
Last active April 1, 2025 21:00
AdBlock filters
https://easylist-downloads.adblockplus.org/antiadblockfilters.txt
https://easylist-downloads.adblockplus.org/easyprivacy.txt
https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt
https://easylist-downloads.adblockplus.org/easylistitaly.txt
https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt
https://gist.githubusercontent.com/salaros/76c61448763c8f5ddd8366dbd8a900af/raw/salaros-custom-filter.txt
# Cleans up old logs messages from journal
sudo journalctl --vacuum-time=2d
# Remove APT package cache
sudo apt clean
# Remove current Linux user's cache
rm -rf $HOME/.cache/*
@salaros
salaros / postgresql_bin_dump_restore.sh
Last active October 17, 2018 15:43
Use pg_restore to restore a binary PostgreSQL dump made by pg_dump
pg_dump -Fc --no-owner --no-privileges --no-tablespaces --clean --schema public --dbname=postgresql://username1:password1@localhost/dbname1 > /tmp/dbname1.bak
pg_restore -Fc --dbname=postgresql://username2:password2@localhost/dbname2 /tmp/dbname1.bak
rm -rfv /tmp/dbname1.bak
@salaros
salaros / elementarize-ubuntu.sh
Last active September 16, 2020 17:12
Make Ubuntu slightly more Elementary OS :-)
sudo add-apt-repository ppa:elementary-os/daily
sudo apt install -qy io.elementary.sound-theme pantheon-files pantheon-terminal
# Disable sounds events
# gsettings set org.gnome.desktop.sound event-sounds false
gsettings set org.gnome.desktop.sound theme-name elementary
# Don't show icons on the desktop
# gsettings set org.gnome.desktop.background show-desktop-icons false
@salaros
salaros / mbw_config_linux_new.sh
Created September 9, 2018 09:26
Mount and Blade configuration script for Linux
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cd "${SCRIPTPATH}"
sudo apt install libsdl2-2.0-0 libsdl2-2.0-0:i386 \
libcurl3-gnutls libcurl3-gnutls:i386 \
libxi-dev libxmu-dev
mkdir -pv QtLibs_bak && mv -v *Qt*.so* QtLibs_bak/
LD_LIBRARY_PATH=$(pwd) ./mbw_config_linux
@salaros
salaros / speed_up_huge_repo.sh
Last active November 3, 2018 14:35
Repair and speed up huge Git repositories
git fsck
git repack -ad
git gc --prune=now
git gc --aggressive
git fsck
@salaros
salaros / StringLocalizer.cs
Created July 14, 2018 14:55
In absence of Microsoft.Extensions.Localization and Microsoft.Extensions.DependencyInjection on .NET Framework < 4.6.1 (4.0, 4.5, 4.6) this class provides an easy access to localized resources
/// <summary>
/// In absence of <see cref="T:Microsoft.Extensions.Localization"/> and <see cref="T:Microsoft.Extensions.DependencyInjection"/>
/// on .NET Framework &lt; 4.6.1 this class provides an easy access to localized resources
/// </summary>
/// <seealso cref="IDisposable" />
/// <inheritdoc />
public class StringLocalizer : IDisposable
{
protected ResourceManager resourceManager;