Skip to content

Instantly share code, notes, and snippets.

View YuriyGuts's full-sized avatar

Yuriy Guts YuriyGuts

View GitHub Profile
@YuriyGuts
YuriyGuts / linux-install-jetbrains-product.sh
Last active December 1, 2018 13:57
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 / cask-upgrade.sh
Last active June 13, 2016 23:41
Check for updates to all Homebrew Cask applications and upgrade them (workaround until cask gets a built-in mechanism for this)
#!/usr/bin/env bash
fetch() {
echo "Removing brew cache"
local cache=$(brew --cache)
rm -rf "$(brew --cache)"
mkdir "$cache"
mkdir "$cache/Casks"
echo "Running brew update"
brew update
@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 June 12, 2018 13:25
Update all Git repositories in the current folder
#!/usr/bin/env python
"""
Update all Git repos in the current directory. Fast-forward only, no merge commits.
Copyright (c) 2018 Yuriy Guts
usage: git-update-all.py
"""
from __future__ import division, print_function
@YuriyGuts
YuriyGuts / github-clone-all.py
Last active January 1, 2024 11:20
Clone all public and private repositories from a specific GitHub user or organization
#!/usr/bin/env python
"""
Clone all public and private repositories from a GitHub user or organization.
Copyright (c) 2018 Yuriy Guts
usage: github-clone-all.py [-h] [--auth-user AUTH_USER]
[--auth-password AUTH_PASSWORD] [--clone-user USER]
[--clone-org ORG]
@YuriyGuts
YuriyGuts / linux-mint-install-everything.sh
Last active February 26, 2024 05:31
A script to install most of the necessary software on a fresh Linux Mint installation. Uses Google Drive to import settings for specific applications. Latest revision: Linux Mint 21.1 Vera / Ubuntu 22.04
#!/bin/bash
# =========== CONFIG =============
# Assuming we'll set the Google Drive folder to ~/GoogleDrive
GOOGLE_DRIVE_FOLDER=$HOME/GoogleDrive
# ================================
# =========== ESSENTIAL ALIASES ==========
INSTALL='sudo apt install --yes'