Skip to content

Instantly share code, notes, and snippets.

View ushkinaz's full-sized avatar
🇺🇦

ushkinaz

🇺🇦
  • Georgia
View GitHub Profile
@ushkinaz
ushkinaz / gist:1003291
Created June 1, 2011 20:53
Renaming with git
find . -name '*Operand*' | awk '{print "git mv " $1 " " $1}' | sed -e s/Operand/Action/2 | bash
@ushkinaz
ushkinaz / cygwin-mirror-speed.py
Last active February 22, 2025 23:45
Tests HTTP mirrors of Cygwin by measuring download times.
#!/usr/bin/env python3
"""
Script to test HTTP mirrors of Cygwin by measuring download times.
Originally written in 2011, modernized in 2025.
"""
from math import floor
from urllib.request import urlopen
import argparse
import sys
@ushkinaz
ushkinaz / GelfFlooder.java
Created February 3, 2012 05:44
Flood Graylog Server
package ru.agent.commons;
import org.apache.log4j.Logger;
import org.graylog2.GelfMessage;
import org.graylog2.GelfSender;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.concurrent.ExecutorService;
@ushkinaz
ushkinaz / jet
Last active October 2, 2015 10:17
Rebuild and launch
#!/bin/bash
# Builds and runs curent module in a jetty container
# Usage:
# jet [profile]
#
# Dependencies:
# maven
# pv
#
@ushkinaz
ushkinaz / validate_properties.sh
Created April 5, 2012 16:04
Как найти проперти, что отсутствуют в local, но есть в dev
#!/bin/bash
# usage:
# validate-properties [env1] [env2]
#
if [[ "$1" == "" ]]; then
env1="d"
else
env1=$1
fi
@ushkinaz
ushkinaz / app_st.sh
Created April 6, 2012 11:22
Статус приложений
#!/bin/sh
for ENV in dev stb exp
do
echo $ENV
ssh logger.dev.agent.ru ls /u06/logs/aslogs/$ENV/*/*-stat | grep [SR] | awk -F "[/\-]" '{printf "%10s %10s %10s %s\n",$6,$7,$8,$9}'
done
@ushkinaz
ushkinaz / post-checkout.sh
Last active October 6, 2015 19:08
Copying config files after checkout
#!/bin/bash
# Config
# ------
# hooks.configenv
ROOT_PATH="$(pwd)"
prev_sha=$1
curr_sha=$2
@ushkinaz
ushkinaz / reimport.sh
Last active December 10, 2015 05:29
Force IntelliJ Idea to reread all dependencies from your maven project
#!/bin/sh
sed -i "/\<orderEntry type=\"library\" /d" */*.iml
sed -i "/\<orderEntry type=\"module\" /d" */*.iml
rm -f .idea/libraries/*
rm -f .idea/artifacts/*
@ushkinaz
ushkinaz / gist:5861997
Created June 25, 2013 20:20
Top 10 most used shell commands, zsh version
fc -l 0 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@ushkinaz
ushkinaz / pack
Last active December 30, 2015 18:39
Форматирует и выводит в консоль файл пакетов Агент.ру Требует наличия в системе: * xsltproc * pygmentize
#!/bin/sh
# Форматирует и выводит в консоль файл пакетов Агент.ру
# Требует наличия в системе:
# xsltproc
# pygmentize
XSL_TRANSFORM='<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">