Skip to content

Instantly share code, notes, and snippets.

View gnurag's full-sized avatar

Anurag gnurag

  • Red Hat, Inc.
  • Far far away land
View GitHub Profile
#!/usr/bin/env sh
i3lock -i ~/.config/i3/lock_screen.png
@iNecas
iNecas / fips_workaround.sh
Last active July 20, 2018 13:30
FIPS Ruby MD5 workaround
# WARNING: for testing only: don't apply to production without testing.
# A set of workaround patches to use different hash algorithm in Foreman and log the usage instead of failing right away.
# https://bugzilla.redhat.com/show_bug.cgi?id=1552159#c5
function puppet-certs {
if grep empty-password /usr/share/katello-installer-base/modules/certs/manifests/ssltools/nssdb.pp
then
echo "Puppet - certs already patched"
return
@dLobatog
dLobatog / -
Created September 20, 2016 09:12
Katello on Foreman (as a plugin)
EL6 support
Battle-tested backup and restore tools for Satellite so we can drop EL6
Cockpit support
Ansible improvements
IPv6 support by the installer
UEFI documentation
Patternfly UX improvements
Removal of Candlepin dependency from Katello
Add Maintenance mode to Satellite
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 10, 2024 18:51
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 14, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Integralist
Integralist / 1. Simplest Rack server.rb
Last active February 22, 2019 09:55
Rack Server Example
run lambda { |env| [200, {"Content-Type"=>"text/html"}, ["Hello World"]] }
@jdp
jdp / redis-delkeys.sh
Created August 21, 2013 19:19
Delete keys matching a pattern from Redis
#!/bin/sh
#
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern
#
# Matches keys with the KEYS command matching pattern
# and deletes them from the specified Redis DB.
set -e
HOST="localhost"
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@justinvw
justinvw / es_simple_autocomplete_example_config.sh
Last active January 26, 2021 17:15
Simple ElasticSearch autocomplete example configuration. The 'autocomplete' functionality is accomplished by lowercasing, character folding and n-gram tokenization of a specific indexed field (in this case "city").
# Delete the possibly existing autocomplete test index
curl -X DELETE localhost:9200/autocomplete_test
# Put the config of the autocomplete index
curl -X PUT localhost:9200/autocomplete_test -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session