Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / ansible-python2-fallback.yml
Created August 30, 2017 08:14
Workaround: ensures python 2 installed to prevent failures on running ansible play on naked 16.04
---
- block:
- name: Raw Python 2 | Bootstrap | Try to gather facts
setup:
rescue:
- name: Raw Python 2 | Bootstrap | Install 'python-minimal'
raw: "test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)"
- name: Raw Python 2 | Bootstrap | Gather facts
@Voronenko
Voronenko / check_by_mask.sh
Created October 13, 2017 09:09
Check for file existance by mask
for f in /path/to/your/files*; do
## Check if the glob gets expanded to existing files.
## If not, f here will be exactly the pattern above
## and the exists test will evaluate to false.
if [ -e "$f" ] then
echo "Mask exists"
fi
## This is all we needed to know, so we can break after the first iteration
break
# netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80
# netsh advfirewall firewall add rule name="Open Port 443" dir=in action=allow protocol=TCP localport=443
New-NetFirewallRule -DisplayName 'HTTP(S) Inbound' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('80', '443')
Get-NetFirewallRule | Where { $_.Enabled –eq ‘True’ –and $_.Direction –eq ‘Inbound’ }
Import-Module WebAdministration
Set-WebConfiguration `
-Filter "/System.webServer/modules" `
-Metadata overrideMode `
-Value Allow `
-PSPath "IIS:\"
@Voronenko
Voronenko / ml.sh
Last active December 2, 2017 11:48
setup virtualenv for jupyter.
mkvirtualenv --python=/usr/bin/python3
# ...
workon ML
pip install numpy
pip install scipy
pip install matplotlib
pip install pandas
pip install scikit-learn
@Voronenko
Voronenko / google group to rss #!aboutgroup slash NAME
Created January 20, 2018 13:28
google group to rss #!aboutgroup/NAME
https://groups.google.com/forum/#!aboutgroup/ansible-project
@Voronenko
Voronenko / git_tag_delete.sh
Created January 22, 2018 18:09
Delete wrong tag from git repository
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
#!/bin/sh
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.33-1.git86f33cd.el7.noarch.rpm
sudo yum install -y docker-ce
@Voronenko
Voronenko / snaps.sh
Created March 3, 2018 17:37
experiment: few ubuntu 16.04 snaps
#!/bin/sh
snap install kubectl --classic
snap install vscode
snap install atom
snap install skype
snap install vlc
snap install slack
snap install telegram-desktop
snap install phpstorm
snap install pycharm-community
@Voronenko
Voronenko / debian-intel-hang.txt
Created March 3, 2018 22:53
debian intel hang
Press Alt+F2 to switch to a new console
sudo apt-get purge xserver-xorg-video-intel then reboot
sudo apt-get install xserver-xorg-video-intel
nano /etc/X11/xorg.conf, remove any present code (if applicable) and enter the following:
Section "Device"
Identifier "Card0"
Driver "intel"
Option "AccelMethod" "sna"
EndSection
Save the file and reboot