Skip to content

Instantly share code, notes, and snippets.

View YuriyGuts's full-sized avatar

Yuriy Guts YuriyGuts

View GitHub Profile
@YuriyGuts
YuriyGuts / chocolatey-install-apps.cmd
Last active March 4, 2026 18:07
A script to install all necessary software on a fresh Windows installation using Chocolatey
@echo off
rem ===== Run this first: =====
rem @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
rem choco feature enable -n=allowGlobalConfirmation
rem mkdir C:\Tools
rem choco install -y toolsroot
rem ===========================
rem ----- Essentials -----
@YuriyGuts
YuriyGuts / DataRobotV2ApiAutopilotDemo.cs
Created June 22, 2018 23:37
C# sample application for interacting with the DataRobot REST API (V2).
// This is an example of a C# application that uploads a CSV dataset to DataRobot,
// runs a classification project in autopilot mode and prints the leaderboard
// using the V2 REST API. Here you can also see an example of interacting with the
// asynchronous API routes (upload project, set target).
// Since the WebClient class has limited HTTP functionality, we use the newer
// Microsoft.Net.Http.HttpClient class. Its methods are async; as a result,
// the C# code uses asynchronous operations too.
// You may need to install the following packages for this code to work:
@YuriyGuts
YuriyGuts / window_arrange.py
Created October 11, 2017 19:20
Save or restore X11 desktop window arrangement using the wmctrl package
#!/usr/bin/env python3
"""
Save or restore X11 desktop window arrangement.
Requires the `wmctrl` package to work.
Examples:
window_arrange.py save
window_arrange.py restore
window_arrange.py --profile ~/.winlayout-home save
@YuriyGuts
YuriyGuts / linux-install-jetbrains-product.sh
Last active February 4, 2026 10:52
[DEPRECATED: use JetBrains Toolbox instead] Download and install any JetBrains product (IntelliJ IDEA, PyCharm, CLion etc.) on Linux.
#!/usr/bin/env bash
# Install or upgrade any JetBrains product on Linux, assuming it is distributed as a tarball
# and has the entry point at $INSTALL_DIR/bin/$PRODUCT.sh
# Tested on IDEA, PyCharm, CLion, DataGrip 2016-2018.*
# Usage:
# install-jetbrains-product.sh [ProductName] [DownloadURL]
#
# Example:
@YuriyGuts
YuriyGuts / titanic-survival-lr.r
Created February 3, 2016 13:11
Predict the survival of RMS Titanic passengers using logistic regression.
# Predict the survival of RMS Titanic passengers using logistic regression.
# Based on Kaggle Titanic dataset: https://www.kaggle.com/c/titanic/data
#
# You might need to install Amelia and ROCR packages.
cleanData <- function(rawData) {
# Uncomment these two lines to visualize the missing data.
# library(Amelia)
# missmap(trainingData, main="Missing vs. observed values")
@YuriyGuts
YuriyGuts / .centos-install-everything.sh
Last active August 31, 2018 18:18
A set of scripts to install most of the necessary software on a fresh CentOS 7 installation. Uses Dropbox to import settings.
#!/usr/bin/bash
# ----------------------
# 00-common-vars.sh
# ----------------------
# =========== CONFIG =============
# Assuming we'll set the Dropbox folder to ~/Dropbox
DROPBOX_FOLDER=$HOME/Dropbox
# ================================
@YuriyGuts
YuriyGuts / rdp-connect.sh
Created August 23, 2015 18:07
Connect to a Remote Desktop (RDP) session through TS Gateway on Linux.
#!/usr/bin/env bash
GATEWAY=gateway.company.com
DOMAIN=company.local
RESOLUTION=1920x1080
if [ -z "$1" ]; then
read -p "Computer name (e.g. CP1234): " COMPUTERNAME
else
COMPUTERNAME=$1
@YuriyGuts
YuriyGuts / gist-clone-all.py
Last active February 26, 2024 05:32
Clones all GitHub Gists for the specified user.
#!/usr/bin/env python
"""
Clone all GitHub Gists for the specified user.
Copyright (c) 2018 Yuriy Guts
usage: gist-clone-all.py [-h] user token
positional arguments:
user Which user's Gists to clone.
@YuriyGuts
YuriyGuts / git-force-update-all.py
Last active August 29, 2015 14:24
Update all Git repositories in the current folder, undoing all local changes if needed
#!/usr/bin/env python
import os
import subprocess
import sys
confirmation = raw_input("This script may DISCARD YOUR UNCOMMITTED CHANGES. Are you sure (Y/N)? ")
if confirmation.lower() != "y":
sys.exit(1)
@YuriyGuts
YuriyGuts / git-update-all.py
Last active March 2, 2026 20:09
Pull latest changes for all Git repositories in a directory (fast-forward only).
#!/usr/bin/env python3
"""
Pull latest changes for all Git repositories in a directory (fast-forward only).
Uses only the Python standard library (no pip dependencies required).
Usage: git-update-all [-h] [--dry-run] [--parallel N] [--quiet] [--verbose] [--version] [directory]
positional arguments:
directory Directory containing repositories (default: current directory)