Skip to content

Instantly share code, notes, and snippets.

@jirrick
jirrick / autoexec.cfg
Created October 3, 2020 06:06
CS:GO binds
fps_max 180
bind w "+forward; r_cleardecals";
bind a "+moveleft; r_cleardecals";
bind s "+back; r_cleardecals";
bind d "+moveright; r_cleardecals"
alias +incvol "incrementvar volume 0 2 0.6; +speed"; alias -incvol "incrementvar volume 0 2 -0.6; -speed"; bind SHIFT +incvol
bind z "use weapon_hegrenade";
@jirrick
jirrick / parse.sh
Last active August 14, 2017 16:19 — forked from cb372/query.json
Using the Elasticsearch scroll API
#!/bin/bash
es_url=192.168.1.2:9200
index=twitch_v2
response=$(curl -s $es_url/$index/_search?scroll=1m -d @query.json)
scroll_id=$(echo $response | jq -r ._scroll_id)
hits_count=$(echo $response | jq -r '.hits.hits | length')
hits_so_far=hits_count
echo Got initial response with $hits_count hits and scroll ID $scroll_id
import java.util.*;
public class FizzBuzz
{
Map<Integer, String> map;
public FizzBuzz()
{
Init();
}
@jirrick
jirrick / reindex.pl
Created June 19, 2017 00:13
reindex ES v1.7
#!/usr/bin/perl
#https://www.elastic.co/blog/changing-mapping-with-zero-downtime
use Search::Elasticsearch 2.03;
my $es = Search::Elasticsearch->new( nodes => '192.168.1.2:9200');
# Reindex docs:
my $bulk = $es->bulk_helper(
@jirrick
jirrick / o365.ps1
Last active May 19, 2017 15:45
O365 Service Health PowerShell Demo
#O365 Service Health PowerShell Demo using https://www.powershellgallery.com/packages/O365ServiceCommunications/1.4
#Jiri Hudec - 19.5.2017
#Check O365ServiceCommunications module is installed
if (Get-Module -ListAvailable -Name O365ServiceCommunications ) {
#Ask for credentials
$cred = get-credential -Message "Please enter your Office 365 Administrator credentials"
#Check credentials
GoogleAssistant
GooglePlus # Skip Google+
Chrome # Skip Google Chrome Browser
CloudPrint # Skip Google Cloud Print
Docs # Skip Google Docs
Drive # Skip Google Drive
Fitness # Skip Google Fit
Keep # Skip Google Keep
NewsWidget # Skip Google News & Weather
@jirrick
jirrick / bt.logcat
Created April 7, 2017 19:54
Lineage BT settings crash
04-07 21:35:47.674 419 419 I MSM-irqbalance: Decided to move IRQ333 from CPU0 to CPU3
04-07 21:35:49.811 4489 4489 I SlideTouchEvent: vel=52.897938, MinimumFlingVelocity=158
04-07 21:35:49.945 4489 4489 I SlideTouchEvent: vel=8.654109, MinimumFlingVelocity=158
04-07 21:35:51.185 975 4534 I ActivityManager: START u0 {act=android.settings.SETTINGS flg=0x10200000 cmp=com.android.settings/.Settings} from uid 10088 on display 0
04-07 21:35:51.332 9268 10571 W System : ClassLoader referenced unknown path:
04-07 21:35:51.333 9268 10571 W System : ClassLoader referenced unknown path: /system/priv-app/CellBroadcastReceiver/lib/arm64
04-07 21:35:51.339 9268 10571 D ApplicationLoaders: ignored Vulkan layer search path /system/priv-app/CellBroadcastReceiver/lib/arm64:/system/lib64:/vendor/lib64 for namespace 0x7f8f6750f0
04-07 21:35:51.426 975 995 D BluetoothManagerService: Message: 20
04-07 21:35:51.426 975 995 D BluetoothManagerService: Added callback: android.bluetooth.IBluetoothManagerCallbac
@jirrick
jirrick / 90less.sh
Last active March 19, 2017 12:54
debugging 90less script
#!/system/bin/sh
LI="log -p i -t 90less" #log-info
LE="log -p e -t 90less" #log-error
run_and_log() #log return status of commands
{
eval "$1"
if [ $? == 0 ]
then
@jirrick
jirrick / gist:5231953
Last active December 15, 2015 08:38
neprocko pyčo
% DU_1 - test prvociselnosti v unarni aritmetice
% Jiri Hudec
% polovina(X,Y) - metoda pro nalezeni poloviny (+1)
polovina(X,Y):-polovina3(X,0,Y).
% polovina3(X,Y,Z) - pomocna metoda pro nalezeni poloviny
polovina3(0,Y,s(Y)).
polovina3(s(0),Y,Z):-polovina3(0,Y,Z).
polovina3(s(s(X)),Y,Z):-polovina3(X,s(Y),Z).
@jirrick
jirrick / gist:2637442
Created May 8, 2012 17:10
CM9 - Wifi settings crash
I/wpa_supplicant( 904): CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:00:00:00:00:00
E/wpa_supplicant( 904): wpa_driver_wext_scan: Start
I/wpa_supplicant( 904): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00
D/AndroidRuntime( 988): Shutting down VM
W/dalvikvm( 988): threadid=1: thread exiting with uncaught exception (group=0x40a421f8)