Skip to content

Instantly share code, notes, and snippets.

View petarvucetin's full-sized avatar

Petar Vučetin petarvucetin

  • Clear Lines
  • Los Angeles
View GitHub Profile
version: '3.5'
networks:
home_network:
external: true
services:
adguardhome:
container_name: adguardhome
image: adguard/adguardhome
Season tier1_from tier1_to tier2_cost tier2_from tier2_to tier2_cost tier3_from tier3_to tier3_cost tier4_from tier4_to tier4_cost
October 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
Novermber 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
December 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
January 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
February 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
March 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
April 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
May 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
June 0 16 8.363 16 24 8.831 24 40 8.577 40 9999 11.076
def my_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
Then you can do:
mod = my_import('package.' + name)
@petarvucetin
petarvucetin / LADPW-electric-rates-tou.csv
Last active January 29, 2022 23:51
LADPW Electric Rates ToU
year month HP LP B
2022 1 0.20526 0.20526 0.18172
2022 2 0.20526 0.20526 0.18172
2022 3 0.20526 0.20526 0.18172
2022 4 0.20326 0.20326 0.17972
2022 5 0.20326 0.20326 0.17972
2022 6 0.26166 0.20326 0.17582
2022 7 0.2697 0.2113 0.18386
2022 8 0.2697 0.2113 0.18386
2022 9 0.2697 0.2113 0.18386
@petarvucetin
petarvucetin / 1.cs
Created May 9, 2021 04:07
Get .net version
private static readonly string ExtensionVersion = FileVersionInfo.GetVersionInfo(typeof(DurableTaskExtension).Assembly.Location).FileVersion;
@petarvucetin
petarvucetin / pull-all-repos-for-project.sh
Last active June 7, 2023 13:04
Get all repositories from Azure DevOps bash
#!/bin/bash
rolesrepo="https://dev.azure.com/[org]/[project]/_apis/git/repositories?api-version=5.0"
personal_access_token="Username:zzzzzzzzz" #create PAT from secruity menu of your user profile.
user=""
base64AuthInfo="$(echo $personal_access_token | base64))"
#printf "The string\n[$personal_access_token]\nencodes into base64 as:\n[$base64AuthInfo]\n"
#curl $rolesrepo -H "Authorization=Basic $base64AuthInfo"
curl --request GET \
@petarvucetin
petarvucetin / ansible.cfg
Created August 25, 2019 03:11
ansible.cfg
[defaults]
roles_path = ~/
host_key_checking = False
stdout_callback = debug
log_path=~/ansible-playbook-log.txt
@petarvucetin
petarvucetin / .bashrc
Created August 25, 2019 03:01
my .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@petarvucetin
petarvucetin / github_repo.py
Created June 8, 2019 18:22 — forked from toast38coza/github_repo.py
An Ansible module for managing github repos
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
#Downloads latest paket.bootstrapper.exe from github
$urlbase = "https://github.com"
$latestPage="$urlbase/fsprojects/Paket/releases/latest"
$exe = "paket.bootstrapper.exe"
Write-Host "Parsing latest release page: $latestPage"
$urlRegex = '<a\s+(?:[^>]*?\s+)?href=(["''])(.*?)paket.bootstrapper.exe\1'
$wc=new-object net.webclient