Skip to content

Instantly share code, notes, and snippets.

View Kutkovsky's full-sized avatar

Dmitry Kutkovskiy Kutkovsky

  • Pochtatech
  • Russia
View GitHub Profile
@Kutkovsky
Kutkovsky / dns-sync.sh
Created April 23, 2020 09:47 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@Kutkovsky
Kutkovsky / Catalina_ISO.sh
Created June 26, 2019 10:17
The steps allowing to create macOS 10.15 Catalina VM on vSphere or ESXi
#!/bin/bash
# Steps to create the macOS Catalina (10.15) VM:
# login to developer.apple.com or beta.apple.com to download a tester's profile for your OS. Install it.
# Go to System Preferences > Software Update and start the update process
# When the Catalina Installer (few MBytes) is started, it downloads the remain part of installation.
# After all `Install Catalina Beta.app` should lay in the /Applications folder with approx. 6.5g size
# Proceed with the following script.
set -eux
@Kutkovsky
Kutkovsky / macOS-mojave-iso.sh
Created June 10, 2019 10:46 — forked from jamieparfet/macOS-mojave-iso.sh
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@Kutkovsky
Kutkovsky / web-servers.md
Created April 26, 2019 18:39 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Kutkovsky
Kutkovsky / highsierra_bootable.sh
Created January 28, 2019 11:34 — forked from agentsim/highsierra_bootable.sh
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@Kutkovsky
Kutkovsky / toggl.py
Last active November 27, 2018 17:11
Another version of Toggl-parser.
#!/usr/local/bin/python3
import sys
import csv
import xlwt
import requests
import json
import pandas
from datetime import datetime
@Kutkovsky
Kutkovsky / togglproceed.py
Last active October 31, 2018 15:06
Togglproceed.py
#!/usr/local/bin/python3
import csv
import xlwt
'''
TODO: import report automatically from toggl.com (token: '<your token here>')
curl -v -u <your token here>:api_token -X GET "https://toggl.com/api/v8/workspaces"
curl -v -u <your token here>:api_token -X GET "https://toggl.com/reports/api/v2/details?page=<report_page_since_its_paginated>&workspace_id=<ourworkspacenumber>&since=2018-10-01&until=2018-10-31&user_agent=api_test"
'''