Skip to content

Instantly share code, notes, and snippets.

View varp's full-sized avatar
🎯
Focusing

Vardan Pogosian varp

🎯
Focusing
View GitHub Profile
@varp
varp / Install-Bria.ps1
Last active July 29, 2019 12:05
Bria 5 Soft Phone installer
param(
[string]$userProfilePath="C:\Users\user",
[string]$fileToFInd="*bria*.exe"
)
$searchRes = Get-ChildItem -Path $userProfilePath -Recurse -File -Filter $fileToFInd
if (-not $searchRes)
{
Out-Host "Installer was not found - in $userProfilePath"
@varp
varp / m3u_from_onedrive.sh
Created March 21, 2019 10:56
Generate m3u playlist with files from OneDrive folder
#!/usr/bin/env bash
onedrivecmd --version > /dev/null || { echo "Run `pip install onedrivecmd` and try again."; exit 1; }
[ $# -eq 0 ] && { echo "Help: m3u_from_onedrive.sh <folder> [playlist name]"; exit 1; }
folder=$1
IFS=$'\n' files=( $(onedrivecmd list "od:$folder" | cut -f1 -d$'\t' | grep -v '/$' | xargs -0) )
export PACKAGESITE=http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/`uname -r`/packages/Latest/
@varp
varp / cross_check_ips.rb
Created April 24, 2015 12:39
Cross check IP addresses
require 'pathname'
require 'whois'
require 'resolv'
# for file in *.log; do cat $file | grep -vi '+http://yandex.com/bots' | grep -vi 'googlebot' > $file.woutbots; done
# for file in *.woutbots; do cat $file | cut -f1 -d' ' > $file.ips; done
# for file in *.ips; do cat $file | sort | uniq > $file.uniq; done
a_folder = ARGV[0] unless ARGV.empty?
b_folder = ARGV[1] unless ARGV.empty? && ARGV.length != 1
@varp
varp / split_apache_log.rb
Created April 23, 2015 13:41
Split apache access log file
require 'date'
apache_log = ARGV[0] unless ARGV.empty?
@cur_date = nil
@next_date = nil
File.open(apache_log) do |f|
for line in f