2024

Google Storage using cURL

1 minute read

I got around to troubleshooting a Python process running in Docker that had some permission problems accessing Google Storage Reproing inside Python with goo...

Serving Images from the DB in Django

5 minute read

I recently got to work on prototyping a small Django-based website that was somewhat like a message board. One of the features requested was allowing users t...

Running GPU workloads on K3S

2 minute read

A team I work with is very happy with the k8s / ArgoCD setup we set up, and now wants to manage their experimental ML workloads in k8s as well. These workloa...

Getting your toppings fast

2 minute read

I recently ran into a friend that wanted some help with an app. Because the app is in super secret stealth mode, let’s pretend instead it’s “Pizza Advisor” -...

Semantic caching with PSQL, Python, OpenAI

5 minute read

You’re an app developer now Let’s say you’re working on an app. The app helps you search for e-mail messages that relate to a certain topic. This works well ...

Java SMPP helper

6 minute read

One of my projects involves communicating over SMS with cellular-connected IoT devices. The company already has a working infastructure for sending and recie...

Adding shortcuts to your search engine

3 minute read

I really like DuckDuckGo’s bangs, which basically directs your query elsewhere if you prefix it with !something. You could search the London zoo in gmaps by ...

Back to Top ↑

2023

Bridging Switcher’s UDP over OpenWRT

1 minute read

Seems like I’m doing this setup once every 3 years, then forget about it until the next time it breaks. I hope this is the last time I’m rediscovering this.

Invalid number: Nov

5 minute read

One of my current projects is migrating a big Java project from Java 8 to a supported version. Since we’re doing small, stable steps, we started with Java 11...

We don’t do DST at this company

6 minute read

Once, a long time ago, I used to have a consulting gig in some big enterprise-y company. It had a lot of unique challenges, being disconnected from the inter...

Patching a Java JAR

4 minute read

I’m working with a company that uses smart IoT devices produced far away. The main troubleshooting tool is a Java utility provided by the manufacturer. This ...

WSL for non-programming security analysts

3 minute read

I have a friend who isn’t a developer and believes that coding is beyond their grasp. They work as a security analyst and prefer using Windows as their opera...

Bash “Keep or Delete” script for PDFs

1 minute read

I recently discovered that I had over 100 PDFs in my “Downloads” directory and needed to determine which ones I wanted to keep. Instead of spending 10 minute...

Is this really an emergency?

6 minute read

One of the teams I worked with would do an “engineering pain-point” survey twice a year. During one of those surveys, the main complaint was that on-calls ha...

a 1.5GB string

4 minute read

In my previous role, I supported a Java service that operated similarly to RDP or Citrix by enabling remote UI functionality. This service relied on sessions...

Get Android App Sizes with ADB

1 minute read

Upon receiving a notification from my NVidia Shield indicating that it was running low on storage space, I attempted to use the device’s interface to trouble...

Sapling Commands

less than 1 minute read

Sapling (the Facebook-released SCM) is great, but the docs are not-great. I thought I’d list some commands it took me a while to undertand, for me and for ot...

Quick Docker Compose commands for ECS

less than 1 minute read

I’m pretty new to Dockering in the wild, and I’m trying to use the new ECS integration to push all of my tiny app to the cloud.

Back to Top ↑

2022

CSV to JSON stream converter in Python

less than 1 minute read

I’ve been working with some govermental data that is available as huge (>50G) CSV files. While there are workarounds to working with large files, I wanted...

Productivity tips for a FAANG engineer

1 minute read

Here are some things I learnt during my career in Facebook, and think could benefit someone new to the field. As an engineer in Facebook, you have a great de...

Arduino Mouse Mover

less than 1 minute read

I have a friend who is working from home. This friend has a manager who’s way of measuring people’s productivity is ensuring said people are active on Slack....

Back to Top ↑

2021

Switching audio bluetooth profiles with a script

less than 1 minute read

I wanted to be able to switch between “listening to music” and “using the headphone’s microphone” easily. i3blocks allows me to write scripts emit a status l...

Back to Top ↑

2020

Back to Top ↑

2019

The BIG BUTTON with Arduino

1 minute read

I’ve created a dramatic big button, that actually sends key presses to the computer. It’s connected to the computer via USB, and programmable via the same co...

Back to Top ↑

2018

Adding a child element in XSLT

1 minute read

I recently had to edit a big XML file, and add a child elemnt to every element within. To simplify matters, say I had something like this: <?xml version="...

Disqus instead of Juvia

less than 1 minute read

TL;DR: I switched from Juvia to Disqus after losing all of my blog’s comments

Sortiq - sort, uniq, sort

less than 1 minute read

This is a small snippet I find extremely useful. You should have it in your ~/.bashrc: sortiq() { sort | uniq -c | sort -rn ; } It will count the instances ...

Back to Top ↑

2017

Populating a NetworkX graph with a scanner

less than 1 minute read

I had a graph living outside Pythonland (a commit tree with dependencies) and wanted to do graphy things to it. To do that, I first had to put the data into ...

Back to Top ↑

2016

DNS Namesake - the DNS MitM

2 minute read

The Story Imagine this situtation: ```text THE WORLD / company.com | A s1.red.company.com A s2.red.company.com … A sN...

DNS Override for a Single Process

1 minute read

The Problem I needed to run a mobile emulator on my laptop, in order to test some DNS server changes before releasing them. However, since the emulator had n...

My tips on Getting a Job

7 minute read

A lot of people (>3) asked me in the last month or so about how to land a first job after leaving the army / graduating from university, so I thought I’d ...

Keeping Windows Awake (with PowerShell)

3 minute read

The story I got a new game on Steam and got set to downloading it. For some reason, Steam and Windows have decided that it’s better to save some electricity ...

Chef “Share This” script

less than 1 minute read

I wrote this little script to upload the current cookbook to the Chef Supermarket. It should be run from within the cookbook’s directory.

Dry Run for Python Pip

3 minute read

As I wrote some time ago, I started my own python cookbook for Chef because I didn’t like the direction the “default” one was going. I recently added a new f...

Filtering in Shell

1 minute read

Today I told someone that a feature I’m missing in Bash is filtering. Then I thought about how much I miss it, so I went ahead and “implemented” it.

Cookbook Versioning Script

5 minute read

The Problem I’ve always disliked releasing cookbook versions manually. The process requires a lot of bureaucratic steps which are easy to forget and require ...

Migrating Grafana’s Dashboards

less than 1 minute read

Similar to my Graphite dashboard migration script, I made a Grafana one. I’m targeting Grafana v2+. Note it’s using http for its HTTP calls. ```ruby old_serv...

Running external Ruby code from Vagrant

6 minute read

The Story Like a lot of Chef users, I’m using Vagrant for testing my cookbooks. I’m also using Berkshelf for providing the Vagrant box with the cookbooks it ...

Parsing AWS billing

3 minute read

The Story I never understood the AWS billing very well and happily left it to my CTO. A couple of days ago, however, my CTO secretly told me he’s mainly inte...

Back to Top ↑

2015

Open-Gridview - the FOSS Out-Gridview

3 minute read

The Story I’ve been a Microsoft SysAdmin for a long time before switching for Linux. During which, I scripted a lot in PowerShell. PowerShell has several “ou...

Using a global lock in Chef

4 minute read

The Story Our dev team is currently using a Snowflake-like ID generation scheme that looks like this: (Diagram by Elad Rosenhim, architect and companion at ...

Enhancing Packer Templates with eRuby

3 minute read

The Problem Packer is a great tool for creating machine images, and I’m using it to create EC2 AMIs. My issue with it is that Packer is using JSON for input,...

Listing Chef Cookbook Licenses

less than 1 minute read

As part of a compliance check for our company, I was required to print the name/version of all FOSS proejcts I’m using. Most of it was digging around Gemfile...

Writing Complex Scripts in HBase Shell

1 minute read

The Story HBase installations include a shell for running arbitrary commands. For instance, if you want to view all of your snapshots, you can do something l...

Running Inline DSL in ChefSpec

3 minute read

The Problem I have a pet Chef cookbook in charge of managing SELinux policies in Linux machines (Take a look). Until today I got along fine without testing, ...

Merging known_hosts files

2 minute read

The Story Some time ago, some colleague rebuilt several servers and reused their names (think sql1,sql2 etc). Obviously the new servers had different SSH ser...

Generating known_hosts file using Chef

2 minute read

The Story This post relates to my previous post. I was trying to create a script to amend my known_hosts file (where SSH keeps fingerprints of all of the ser...

Chef Snippets

1 minute read

I thought I’d upload some interesting Chef-related snippets I accumulated.

How Chef’s use_inline_resources works

2 minute read

I recently had an issue with use_inline_resources. This feature’s documentation is lackluster, and I learnt about its magic thanks to some scraps of informat...

Migrating Graphite’s Dashboards

less than 1 minute read

I just made a small script to migrate dashboards between two graphite servers. Couldn’t find a similar one anywhere, so I thought I’d upload it. Note it’s us...

Sending mail on coredumps

4 minute read

The Story I recently found out that some of our backend code suffers from memory-related ceashes, namely SIGSEGV (a program tries to access memory it doesn’t...

Using RPMBuild - My Shortlist

3 minute read

The Story I was trying to tinker with Abrt, a daemon in charge of collecting and diagnosing various crashes in RHEL (more on that in a different post). Becau...

Preparing Certificate files for Nginx

1 minute read

The Story When installing SSL certificates for nginx, assuming you’re using certificate hierarchy (and not a self-signed ceritificate), you’re required to co...

Installing Growroot on CentOS

4 minute read

The story I currently work with CentOS on Amazon EC2. As I previously written, The HVM version of the AMI is created with a partitioned disk, instead of havi...

Chroot Snippet

less than 1 minute read

The Story Some time ago, my PC wouldn’t boot. This was my fault, as I needed to resize some partition, and resizing in Linux really means deleting the partit...

Managing EC2 reservations with Scripts

2 minute read

The Story Since we tend to hold our AWS EC2 VMs for a long time, we usually reserve them. Reservations are like pre-buying instances - you pay AWS ahead of t...

Appending Newline to File Ends with Ruby

less than 1 minute read

I recently took over managing some config files from my dev colleagues. I was extremely annoyed to be reminded that Notepad (Windows’ text editor) does 2 maj...

Init file for HBase Thrift Server

2 minute read

As part of our HBase setup, we run Thrift servers. This is pretty simple, except for the init files. Since we’re running Thrift standalone (and not as part o...

Scripting YUM provides search using Python

1 minute read

Update 24-06-15 Thanks to this page, I fixed my script. It no longer requires root privillages. I also muted informational messages because they were not ver...

Batch fitting pictures in ImageMagick

1 minute read

I recently bought a digital frame for some of my more elderly relatives. The frame’s firmware was quite retarded, and I had 2 issues with it:

Managing chef users with Chef

2 minute read

I needed to create seperate Chef accounts for some utility program running in my Chef server. I was finally able to deprecate it today, but I saved those sni...

Locking Down Jenkins’ Authentication

4 minute read

Update 19.02.15 After posting my script in the Jenkins mailing list, I was told about a simpler way for implmenting my authorization strategy. I’m leaving th...

Resizing AWS root EBS in CentOS HVM

3 minute read

Update 04.07.15 This method doesn’t work anymore because of some weird AWS restriction, which says you can’t connect the root device of a marketplace AMI (li...

Booting with UUID without initramfs

2 minute read

The Story I recently wiped my CubieTruck (a single board computer, like RaspberryPi), and tried installing the root filesystem on a hard drive instead of the...

Getting Git Submodule Detailed Status

1 minute read

The Story I manage every one of my Chef cookbooks as a single git repository, complying with the BerkShelf paradigm. I keep them all as submodules in a “supe...

CSV Tricks

1 minute read

The Story I’ve been requested to recreate some spreadsheet for our execs. Being annoying as usual, I made it a point to only use scripting to build the table...

Troubleshooting StatsD

1 minute read

About StatsD StatsD is a tool developed by Etsy and Flickr (complicated story). Its main use is providing a middleman for Graphite, which is a real-time grap...

Back to Top ↑

2014

SSH vs OpenVPN for Tunneling

5 minute read

Update 28.01.16 I found some sites referring to this post. Below are the common complaints I saw, and my replies:

AWS’s Block Device Mapping in CentOS

2 minute read

The Story I’m using Amazon’s EC2 for some of my VMs, which run CentOS. When viewing Block Device Mappings (mapping between the virtual storage - ebs, epheme...

Git Prompt Variables

2 minute read

I recently reinstalled my laptop and had to reconfigure my git prompt. I use the git prompt script that is included in Ubuntu’s git package, and integrate it...

Validating network segments using Puppet

1 minute read

The Problem When configuring KeepaliveD using Puppet, sometimes an interface name has to be used. Imagine a server with 2 interfaces (eth0,eth1), where one i...

Linux and SSDs - Should You TRIM?

3 minute read

Note: Although my experience is with Debian, I think this post helps anyone using some modern Linux distribution. What is TRIM? As a Windows sysadmin, I didn...

Why Pinning

2 minute read

There are plenty of guides about apt pinning, but no one really explains the motivation to do so. It took me some time to understand that, so I thought I’d w...

My Pinning Guidelines

4 minute read

In my previous post about pinning I talked about the reasons to configure apt pinning. This post details my logic about what and how to pin.

Adding Repositories for Inspection

less than 1 minute read

Sometime I want to inspect software repositories. However, I don’t want my machine to actually install anything from it. To do so, I made a small bash functi...

Setting up Gargoyle as a Time Server

1 minute read

The Story For reasons unknown to me, Debian’s NTP daemon only works on udp port 123, even when operating as a client. This is a problem because my network c...

Timing Execution By Output Lines

1 minute read

The Story Today I got annoyed that some puppet agent runs took me over 90 seconds to complete, even though they actually did nothing (no change was needed). ...

Fixing Ugly Hebrew on Ubuntu + Firefox

less than 1 minute read

The default viewing experience, when visiting some Hebrew sites when using Firefox on Ubuntu, is quite unsightly. If we check Ynet.co.il, a news site, we’ll ...

Mass-Checking SSH Connections using Parallel

1 minute read

Today I wanted to make sure I have SSH access to about 100 servers. Obviously, I wasn’t going to verify the list by hand, so I put all of the servers’ names ...

Finding Accounts Trusted for Delegation

2 minute read

As part of a security audit, I was asked to help in finding all accounts marked with “Trusted for Delegation” What is “Trust for Delegation” You can try rea...

Setting Up Samba on Raspberry Pi

2 minute read

After setting up my rPi TorrentBox, I wanted to let my family access the downloaded files. Since they use Windows (and I don’t want to bother their systems w...

Avoiding Text Overflow with Prettify on Blogger

less than 1 minute read

I’m currently testing Prettify to replace SyntaxHighlighter as the syntax-highlighting solution in my blog. By the way, it’s nothing critical, but Blogger’s ...

setspn Duplicates and Case Sensitivity

less than 1 minute read

Today I found out that the command I use to find duplicate SPNs, setspn -x is case sensitive, meaning that the following SPNs don’t count as duplicates: HOS...

Back to Top ↑

2013

Network Monitor capture filter limitations

1 minute read

I recently had to deal with some network traffic issues, so naturally I turned to NetMon. My problem was with some TCP packets not reaching their destination...

Filtering Windows Event Log using XPath

4 minute read

When I want to search for events in Windows Event Log, I can usually make do with searching / filtering through the Event Viewer. For instance, to see all 46...

Removing all Metro Apps from Windows 8

less than 1 minute read

I wanted to open some photos today (to add to my blog) on my Windows 8 workstation, and it kept opening the full-screen metro app instead of the normal pictu...

Group Policy Security Filtering and Loopback

less than 1 minute read

I recently discovered that when applying a GP object using loopback and user security filtering (allowing only specific users to apply the GP), the computer ...

Wget in PowerShell v3

less than 1 minute read

I’ve been envying my *nix brethren for having Wget for a long time. To get the contents of a web page or download a file using http I had to use workarounds ...

Testing actual SMB version

1 minute read

Ever since I got employed in my present company, I’ve been told that our NetApp Filer supports SMB2 when used as NAS. I was always skeptic of that (due to h...

Mass Setting Permissions on Remote Shares

2 minute read

I was recently asked by one of my teammates to add several NTFS permissions to the root folders of a bunch of shares. Seems easy, but I had two problems:

Finding WSUS Clients by SusClientId

less than 1 minute read

Today someone showed me a strange problem - he had servers that recently installed new updates from his WSUS server, but he couldn’t find them in the WSUS co...

Back to Top ↑

2012

Reverse Lookup in SharePoint 2010

1 minute read

Every SharePoint noob knows that one can create list lookup relationships, like specifying that a book belongs in a specific bookshelf. What I didn’t know un...

Brute Force Guessing for User Passwords

1 minute read

Our security team complained to me that they found a lot of users with trivial passwords simply by trying to log in as them. They asked me to write them a sc...

Windows Event Collection

3 minute read

I’ve recently implemented an enterprise-wide solution of event collection in our organization, using Windows’ built-in mechanism called the Windows Event Col...

Windows Event Collection

3 minute read

I’ve recently implemented an enterprise-wide solution of event collection in our organization, using Windows’ built-in mechanism called the Windows Event Col...

Automaticlly Extracting Downloaded Torrents

1 minute read

As every average geek, I too download torrents (containing only legal, copyright-free material, of course), and most of the time the torrents contain multi-f...

Determining Size of all Tables in a Database

less than 1 minute read

Just a quick SQL script to get the rowcount and size data of every table in the current database: CREATE TABLE #sizeof ( name varchar (70), [rows] int, re...

Creating proxied http requests with PowerShell

less than 1 minute read

I’m working on some sort of HTTP proxy (maybe more details about it later), and to test it I’ve created a short PowerShell script. Note it also performs basi...

Extending Yii’s Web Application Creation

1 minute read

I found out that after creating my Yii Applications through Yiic.bat, I tend to modify the same things in all of them (adding .htaccess files for pretty urls...

Creating a common Yii code directory

less than 1 minute read

Yii natively supports code recycling, by allowing you to store common code in modules, widgets etc. However, to share code between applications, you still ha...

Back to Top ↑

2011

Google Friendly Apache Domain Migration

2 minute read

I recently migrated a domain for a client, and did it like a noob (as in simply copying the db and files, making sure everything’s working, and then shutting...

Dumping your MySQL db using PHP

less than 1 minute read

Hi. One of my clients asked me to be able to take manual backups of his DB, and because he wasn’t so technologically-inclined, using the hosting company’s in...

Setting Dynamic RPC Port Ranges

3 minute read

We recently had to manually set the dynamic RPC port range in our servers, mainly because Exchange 2010 sets the port range so wide that the firewall guys (r...

Making your pages more Facebook shareable

less than 1 minute read

I’m working on a project involving Gallery 3, and one of my goals was tight Facebook integration. Today I’ve wanted to make sure that when someone shares a p...

Lowercasing PTR records in DNS

1 minute read

Recently, one of the IT crowd informed me that he can’t delete some of his PTR records through the DNS management console (dnsmgmt.msc). The record would app...

Enabling Remote Desktop Remotely

less than 1 minute read

According to this Technet article, to enable remote desktop remotely by using the registry you need to set the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSe...

Speed boosting disconnected environments

less than 1 minute read

Hi there. Not a while ago, I’ve created a post about stsadm.exe / new SPSite() being slow in disconnected environments. Just wanted to point out that I’ve tr...

Internet Explorer and SPNs

less than 1 minute read

After learning how SPNs work (read my “Who? Why? Where” to learn what’s an SPN), I was frustrated to find out that I can’t implement my experience in the rea...

Back to Top ↑

2010

Checking for conflicting oIDs

1 minute read

I got word that this script was useful for some other IT team, so it’s definitely blog-worthy! The Story I’ve inherited some AD forests with their schema ext...

Vanishing permissions on AD objects

1 minute read

I recently managed to solve a problem that bugged me for a ~ year - permissions on a specific group on AD would vanish, and the change won’t show up on the s...

Stsadm / new SPSite is slow

3 minute read

Update: Get the script here The Story A couple of days ago, developer extraordinaire Itay Shakury was doing performance tuning on one of our SharePoint appli...

A few seconds about psbase

less than 1 minute read

I really like Powershell’s dynamic type system, which allows you to, among other things, view XML nodes really easily. For example, to view the connectionStr...

SPNs - Who? Why? Where?

4 minute read

I was making an introduction to a new teammate about SharePoint infrastructure, and one of the things I had to teach her about was SPNs. I was surprised to k...

2008 Clusters can’t change password

1 minute read

Last week MS’s PFE Moti Bani and me solved a problem that bugged me for ~ a year - since the day we’ve started deploying 2008 clusters in our production envi...

Get-BigDirectories

1 minute read

Note: This script is better than just ls -rec | measure, because measure measures only one field, and when iterating over many files and directories, every i...

Auto-Sorting Computers in WSUS

less than 1 minute read

When I installed my first WSUS server, I liked the idea of auto-assigning computers into different WSUS groups according to domains using the group policy’s ...

Querying SQL Servers

1 minute read

Before I had a chance to study Microsoft’s SQL Server Management Studio (SSMS)’s Powershell SnapIn, I needed to grab some data from an SQL DB. I ended up cre...

New blog… yay

less than 1 minute read

Hi. My name is Nitzan, and I’m a MS-IT guy. Whenever I run into a problem I can’t solve during my work, I almost always end up finding the answer in some blo...

Testing stranded group policies

1 minute read

Ever had GPO Version differences between the AD and the Sysvol? Sure, you might have a healthy FRS/DFSR architecture, but the replication takes time. It’s an...

Back to Top ↑