Skip to content

Instantly share code, notes, and snippets.

View jkugler's full-sized avatar

Joshua Kugler jkugler

View GitHub Profile
@jkugler
jkugler / gist:4928e3239edad10b262d95a20c144768
Last active January 19, 2023 07:12
Reducing resolution on HiDPI/4K displays for text-based installers
I recently installed Ubuntu server on a laptop with a 4K display. While the installer appears to be in text, it apparently uses a graphical mode, and setting vga=799 in the kernl boot parameters did not work.
To decrease the resolution, you have to pass a kernel boot parameter with the monitor "name" as seen by edid.
You can do this to list monitors without xrandr
find /sys/devices -name "edid"
That will produce a listing like this:
#!/bin/bash
POSITIONAL=()
AWSTATS_PROG=$(which awstats.pl 2> /dev/null)
BUILD_STATIC_PROG=$(which awstats_buildstaticpages.pl 2> /dev/null)
OUTPUT_DIR="./"
while [[ $# -gt 0 ]]; do
key="$1"
#!/usr/bin/env ruby
def eval_script filename
# Creates a new empty hash when accessing a hash that doesn't exist
default = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
eval(File.read(filename), binding, filename)
default
end
# All data from default.rb now available in 'default'
@jkugler
jkugler / gist:0f65a22c0fef3dd91125
Created August 22, 2014 20:44
Exhibition of bug in per-(system|profile) templates
For example, we have this block:
if $is_service_node; then
cat > /etc/chef/solo.rb << EOF
file_cache_path "/var/tmp/chef-solo"
role_path "/var/tmp/chef-solo/roles"
data_bag_path "/var/tmp/chef-solo/bags"
cookbook_path "/var/tmp/chef-solo/cookbooks"
json_attribs "https://server/path/to/$solo_name"

Keybase proof

I hereby claim:

  • I am jkugler on github.
  • I am jkugler (https://keybase.io/jkugler) on keybase.
  • I have a public key whose fingerprint is 660E 9078 A0E7 8279 0B9F DA32 6810 8CBB 73B1 3B6A

To claim this, I am signing this object:

@jkugler
jkugler / google-analytics-example.py
Created September 11, 2011 06:05
Google analytics examples
#!/usr/bin/python
import gdata.analytics.client
def main():
# source=os.path.basename(__file__) makes the "user agent" the name of the file
ga_client = gdata.analytics.client.AnalyticsClient(source=os.path.basename(__file__))
print "Getting list of GA Accounts...",
@jkugler
jkugler / gist:735374
Created December 9, 2010 21:36
Populating a MS AdCenter report request
bsrr = client.factory.create('BudgetSummaryReportRequest')
bsrr.Format = 'Csv'
bsrr.ReturnOnlyCompleteData = True
bsrr.Language = "English"
bsrr.Time.CustomDateRangeStart.Year = 2010
bsrr.Time.CustomDateRangeStart.Month = 12
bsrr.Time.CustomDateRangeStart.Day = 1
bsrr.Time.CustomDateRangeEnd.Year = 2010
bsrr.Time.CustomDateRangeEnd.Month = 12
bsrr.Time.CustomDateRangeEnd.Day = 31