This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import sqlite3 | |
if len(sys.argv) < 3: | |
print(f"Usage: {sys.argv[0]} <year_start> <year_end>") | |
sys.exit(1) | |
year_start = int(sys.argv[1]) | |
year_end = int(sys.argv[2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for r in $(dnf repolist | egrep -v "^repo" | awk '{print $1}') ; do dnf repository-packages ${r} list > ${r}.txt ; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.parse | |
import boto3 | |
import tempfile | |
from datetime import datetime | |
account_id = 'XXXXXXXXXX' | |
db_name = 'archive-db' | |
vault = 'archive-vault' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
печать = print | |
def пожалуйста(func): | |
def wrapper(): | |
func() | |
печать(', пожалуйста ', end='') | |
return wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Borrowed from here: https://stackoverflow.com/questions/18338585/how-to-get-the-instance-name-from-the-instance-in-aws | |
# This requires AWS CLI to be installed in the instance | |
INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
INSTANCE_NAME=`aws ec2 describe-tags --filters Name=resource-id,Values=$INSTANCE_ID --query Tags[].Value --output text` | |
export PS1="[\u@$INSTANCE_NAME \W]\\$ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
dynamodb = boto3.resource('dynamodb') | |
table = dynamodb.Table("users") | |
response = table.get_item() | |
response = table.get_item(Key={ | |
'user_id': 'REDACTED', | |
'user_name': 'John' | |
}) | |
for k in response['Item'].keys(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# This script pings a site specified in the command line and | |
# turns the LED on if the site is on. It should be run as root because | |
# it uses sockets in the ping implementation below. | |
# | |
# Code for ping below is borrowed from https://gist.github.com/pyos/10980172 | |
# | |
import time | |
import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: naming sequence | |
connection: local | |
hosts: localhost | |
vars: | |
- names: ['cs','cs','cs','cs','cs',] | |
- numbers: [] | |
- n_instances: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Shell script that configures gnome-terminal to use solarized theme | |
# colors. Written for Ubuntu 11.10, untested on anything else. | |
# | |
# Solarized theme: http://ethanschoonover.com/solarized | |
# | |
# Adapted from these sources: | |
# https://gist.github.com/1280177 | |
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/ |
NewerOlder