Skip to content

Instantly share code, notes, and snippets.

View gm3dmo's full-sized avatar

David Morris gm3dmo

  • GitHub Staff
  • York
  • 21:34 (UTC)
View GitHub Profile
# perl octal permission printer
perl -e 'printf "%04o %s\n", (stat)[2] & 07777, $_ for @ARGV' *
@gm3dmo
gm3dmo / select-all-tickboxes.md
Last active October 10, 2023 08:34
Select all tick boxes in browser

Select all tickboxes in a browser screen

Chrome Developer Tools/Mozilla Developer tools.

Go to the console and paste:

$$('input[type="checkbox"').map(i => i.checked = true)

Chrome Profiles

Matching profile numbers with names

We want to be able to start a Chrome session with the profile of a particular user

cat /Users/${USER}/Library/Application\ Support/Google/Chrome/Local\ State  |
jq -r ' .profile.info_cache | . '
@gm3dmo
gm3dmo / ms-access-97-cannot-export-csv.md
Last active October 8, 2023 08:29
Microsoft Access

Microsoft Access

MS Access 97 cannot export CSV files.

Reregister the mstext35.dll file by running a cmd window and cd to c:\windows\system32 then run regsrv32.exe mstext35.dll. Click "ok" when it says it has reregisted the dll.

MS Access Text Export

File, Save As/Export, To an External File Change Save as type to "Text Files"

@gm3dmo
gm3dmo / migrating-a-java-app-from-the-stone-age.md
Last active October 8, 2023 09:31
Note on migrating a java application from the stone age

Migrating a Java Application from the Stone Age

  • Check classpath ordering (readdir works differently on Solaris, which can be very upsetting for your java application.
  • Things that have **classpath/*** can be upset.
  • Oracle RBMS: JDBC Driver. Lots of older java apps were using classes12.zip which wont work with Oracle 10/11.
  • Stuck with old JRE version. Old JRE Version does not work on new Linux because Libc RHEL3, RHEL4, RHEL5 to RHEL6, RHEL7.
  • They lost the source code! (can’t rebuild recompile easily). How did this Big 5 ever win a contract. Unless you contracted with them to lose the source code.
  • The IPv6 thing. -Djava.net.preferIPv4Stack=true has fixed the web server not listening problem. It was listening only on the IPv6 address on linux. This had never been a problem because even though Solaris was invented in the stone age it was configured with IPv6.
  • WebApp Servers like Weblogic/Websphere that have utilities that use Jython/Jruby could be a life saver.
  • If it's going in a do
@gm3dmo
gm3dmo / csv-anonymize.py
Last active November 1, 2019 18:40
Anonymizing data in CSV Files
#!/usr/bin/env python
"""
"""
__author__ = "David Morris"
__version__ = "0.1.0"
__license__ = "MIT"
import os
import sys
import csv
import logzero
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
Emit Consul environment variables so the can be eval'led
eval `python envsetup.py`
/consul/config/server_details
@gm3dmo
gm3dmo / github-enterprise-setup.md
Created August 21, 2019 07:47
Notes on setting up GitHub enterprise
What breaks?
Github Connectivity
Configuration
Administrative Access
SSH
SSL Certificate
Authentication
License
Time Synchronisation (NTP)
import pygame
import time
import sys
CODE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',
'J': '.---', 'K': '-.-', 'L': '.-..',
'M': '--', 'N': '-.', 'O': '---',
'P': '.--.', 'Q': '--.-', 'R': '.-.',