Listing Modules In Dynamically Linked Shared Object Libraries
We had to rebuild a server over the weekend — it’s a lot harder to get Apache and PHP set up when you don’t have root access to just install things from the yum repository. And, unlike the servers where I built httpd and php from source … we basically relayed requests to the Unix admin to have packages installed. One of the confusions during the whole process was that we didn’t know what to use as the module name for PHP to load in the httpd.conf file. The line from our old server (LoadModule php5_module /etc/httpd/modules/libphp5.so) produced an error that there was no such thing to load.
When a library fails to load with some error, I know to use ldd … but I didn’t know there was a way to list out the modules in a library. Fortunately, one of my coworkers had already run nm and listed out the modules — nm -D –defined-only sharedLibraryFile | grep module — and we were able to identify that the libphp5.so that we had wasn’t anything like the one on the old server. By listing the modules for each of the shared object libraries installed by the php package, we got the proper module name for httpd.conf
Testing A New Web Server Without DNS Changes
When migrating to a new server, it’s good to validate site functionality before redirecting users to the new host. i.e. I have anya.rushworth.us set up in the httpd config on both server1 and server2. DNS currently points traffic to server1, but I need to test the site on server2.
Approach #1 – With administrative access to the host
Edit your hosts file – open an administrative command prompt

Edit %SYSTEMROOT%\system32\drivers\etc\hosts and add lines with the IP address WHITESPACE and the hostname(s). E.G.
127.0.0.1 lisatest lisatest.rushworth.us lisatest2 lisatest2.rushworth.us
10.1.2.3 otherhost otherhost.rushworth.us
10.2.3.4 anya anya.rushworth.us
Clear your DNS cache (ipconfig /flushdns) and navigate to the URL. You’ll be directed the IP address from your hosts file instead of the DNS registered address.
Approach #2 – No admin access
Install ModHeader in your Chrome browser and click the extension to modify the headers or install ModHeader in your Firefox browser. Click on the extension icon to set a header value.

Add a “Host” header with the value of the virtual host name you need to test

Navigate to the hostname of the new server – https://server2.rushworth.us – but the web server will receive the Host header you configured in ModHeader and serve the web site based on that host header.

Docker – Exec As Root
When shelling into a container isn’t root and you need it to be (i.e. you don’t have the root password and sudo isn’t set up), you can pass a uid number to the exec command and run the shell under root explicitly:
docker exec -u 0 -it ENGCurrentTest /bin/bash
Creamy Corn Chowder
Creamy Corn Chowder
Course: Dinner, SoupsCuisine: AmericanDifficulty: Easy4
servings30
minutes40
minutesIngredients
2 Tbsp butter
1 medium onion, chopped
2 cloves garlic, minced
5 ears fresh corn, kernels cut from cobs
6 cups stock (veggie, chicken)
1 lb potatoes, diced
2 tbsp corn starch
Bacon (or veggie bacon)
Cheddar cheese
Method
- Melt the butter in a stock pot and saute onions until translucent.
- Add garlic and saute until fragrant
- Add corn kernels and saute until they start to caramelize
- Add stock, corn cobs, and potatoes. Simmer for 30 minutes.
- Mix cornstarch with a little water to form non-Newtonian fluid. Slowly mix into soup to thicken broth.
- Near the end of cooking time, saute bacon.
- Ladle soup into bowls. Sprinkle with cheddar cheese and bacon.
Microsoft Teams Reply and New Thread Delineation
Exporting A Microsoft Teams Chat
I’ll prefix these instructions with a disclaimer – your company may have document retention in Teams. When you export your chat content, you’ll need to maintain appropriate retention policies yourself. In IT, we had a few information categories where retention was “useful life” – we could retain system documentation as long as the system was used. If you’re exporting a chat to keep something you are allowed to keep and then keep it outside of Teams … that’s awesome. If you are trying to keep something the company’s retention policy says should be removed … that’s probably not awesome.
Once you’ve determined that the info you are exporting is OK to export and maintain elsewhere, here’s how to export a Teams chat from within the Teams web client. Step 1, of course, is to lot into Teams at https://teams.microsoft.com and go to the chat you want to export. Scroll up to the top of the chat. If you have a really long chat, it may not be possible to export the entire thing using this approach. I might play around with it in the future, by most of my conversations are in Teams channels so I don’t have a chat that’s more than 30 or so messages.
Once you are at the top of the chat, open the developer tools (ctrl-shift-i in Chrome). Clear the errors — they clutter up the screen.

Paste the following script into the console and hit enter:
var strRunningText = "";
var collectionMessageBubbles = document.querySelectorAll('.message-body-content, .message-datetime');
for (let objMessageBubble of collectionMessageBubbles) {
strRunningText = strRunningText + "\n" + objMessageBubble.textContent;
}
console.log(strRunningText);

If you have a long series of chat messages, you’ll get some of the chat displayed and a button to copy the entire chat content to your clipboard.

If you have a shorter series of chat messages, you’ll have the text of the chat in the console window. You can highlight it and copy/paste the text elsewhere.
There’s a little cleanup that can be done – the content of the message-datetime elements have a beginning and trailing newline character along with a bunch of whitespace. You can get a cleaner timestamp (but, if you embed code within your messages … which I do … the code sections have a lot of extraneous newlines):
var strRunningText = "";
var collectionMessageBubbles = document.querySelectorAll('.message-body-content, .message-datetime');
for (let objMessageBubble of collectionMessageBubbles) {
strRunningText = strRunningText + "\n" + objMessageBubble.innerText;
}
console.log(strRunningText);
The same JavaScript works in the Teams channel conversations except the channel conversations tend to be longer … so you’re going to export some subset of the channel conversation around where you are in the web browser.
* I realized, during a multi-person chat last week, that I don’t grab the name of the individual who posted the message to the chat. Grabbing the person’s name should just entail adding the identifier for the name element into the querySelectorAll list … but that’s not something I’ve had an opportunity to check yet.
Outlook Web Grammar Check
Dynamically determining AD Page Size
Question — is it possible to dynamically determine the maximum page size when communicating with AD via LDAP? Since the page size (1) changed between versions and (2) can be user-customized … a guess is sub-optimal.
Answer — yes. If only the default query policy is used, search at
CN=Default Query Policy,CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,*domain naming context* (e.g.
CN=Default Query Policy,CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=example,DC=com) with a filter like “(&(cn=*))”
Return the ldapAdminLimits attribute. Parse MaxPageSize out of the attribute:
lDAPAdminLimits (13): MaxValRange=1500; MaxReceiveBuffer=10485760; MaxDatagramRecv=4096; MaxPoolThreads=4; MaxResultSetSize=262144; MaxTempTableSize=10000; MaxQueryDuration=120; **MaxPageSize=1000**; MaxNotificationPerConn=5; MaxActiveQueries=20; MaxConnIdleTime=900; InitRecvTimeout=120; MaxConnections=5000;
To find all of the query policies, search at CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,*domain naming context* for (&(objectClass=queryPolicy)) … either research a lot about query policies and figure out how to determine which applies to your connection or take the lowest value and know you’re safe.
Minority Rule
Number of people represented by each rep in the Senate:
This is where I’d know small populations are over-represented. Two senators regardless of population — a state with a hundred residents would have two senators. Obviously we don’t have a state with a hundred residents — but the least populous states are the ‘best deal for residents’ list — lowest number of people represented by each Senator
| Size Rank | State | 2010 Population per Census | Senators | # Represented per Senator |
| 52 | Wyoming | 563,626 | 2 | 281,813.0 |
| 50 | Vermont | 625,741 | 2 | 312,870.5 |
| 49 | North Dakota | 672,591 | 2 | 336,295.5 |
| 48 | Alaska | 710,231 | 2 | 355,115.5 |
| 47 | South Dakota | 814,180 | 2 | 407,090.0 |
| 46 | Delaware | 897,934 | 2 | 448,967.0 |
| 45 | Montana | 989,415 | 2 | 494,707.5 |
| 44 | Rhode Island | 1,052,567 | 2 | 526,283.5 |
| 43 | New Hampshire | 1,316,470 | 2 | 658,235.0 |
| 42 | Maine | 1,328,361 | 2 | 664,180.5 |
And the most populous sates are the ‘worst deal for residents’ list — highest number of people represented by each Senator
| Size Rank | State | 2010 Population per Census | Senators | # Represented per Senator |
| 1 | California | 37,253,956 | 2 | 18,626,978.0 |
| 2 | Texas | 25,145,561 | 2 | 12,572,780.5 |
| 3 | New York | 19,378,102 | 2 | 9,689,051.0 |
| 4 | Florida | 18,801,310 | 2 | 9,400,655.0 |
| 5 | Illinois | 12,830,632 | 2 | 6,415,316.0 |
| 6 | Pennsylvania | 12,702,379 | 2 | 6,351,189.5 |
| 7 | Ohio | 11,536,504 | 2 | 5,768,252.0 |
| 8 | Michigan | 9,883,640 | 2 | 4,941,820.0 |
| 9 | Georgia | 9,687,653 | 2 | 4,843,826.5 |
| 10 | North Carolina | 9,535,483 | 2 | 4,767,741.5 |
Number of people represented by each rep in the House of Representatives:
But the apportionment in the House of Representatives isn’t as equitable as one might assume. It’s a different list of states under- and over- represented … but one rep from Rhode Island represents half a million people. One rep from Montana represents just short of a million people!
Best deal for residents — small number of people represented by each rep
| Size Rank | State | 2010 Population per Census | Reps | # Represented per Rep |
| 44 | Rhode Island | 1,052,567 | 2 | 526,283.5 |
| 52 | Wyoming | 563,626 | 1 | 563,626.0 |
| 39 | Nebraska | 1,826,341 | 3 | 608,780.3 |
| 38 | West Virginia | 1,852,994 | 3 | 617,664.7 |
| 50 | Vermont | 625,741 | 1 | 625,741.0 |
| 43 | New Hampshire | 1,316,470 | 2 | 658,235.0 |
| 24 | South Carolina | 4,625,364 | 7 | 660,766.3 |
| 21 | Minnesota | 5,303,925 | 8 | 662,990.6 |
| 42 | Maine | 1,328,361 | 2 | 664,180.5 |
| 13 | Washington | 6,724,540 | 10 | 672,454.0 |
Worst deal for residents — high number of people represented by each rep:
| Size Rank | State | 2010 Population per Census | Reps | # Represented per Rep |
| 45 | Montana | 989,415 | 1 | 989,415.00 |
| 46 | Delaware | 897,934 | 1 | 897,934.00 |
| 47 | South Dakota | 814,180 | 1 | 814,180.00 |
| 40 | Idaho | 1,567,582 | 2 | 783,791.00 |
| 27 | Oregon | 3,831,074 | 5 | 766,214.80 |
| 31 | Iowa | 3,046,355 | 4 | 761,588.75 |
| 25 | Louisiana | 4,533,372 | 6 | 755,562.00 |
| 28 | Oklahoma | 3,751,351 | 5 | 750,270.20 |
| 18 | Missouri | 5,988,927 | 8 | 748,615.88 |
| 32 | Mississippi | 2,967,297 | 4 | 741,824.25 |
Electoral College:
The combination of which yields the over and under representation in the Electoral College (and the reason I think the National Popular Vote Interstate Compact is such a good idea).
Best deal:
| Size Rank | State | 2010 Population per Census | Electoral Delegates | # Represented per Delegate |
| 52 | Wyoming | 563,626 | 3 | 187,875 |
| 51 | District of Columbia | 601,723 | 3 | 200,574 |
| 50 | Vermont | 625,741 | 3 | 208,580 |
| 49 | North Dakota | 672,591 | 3 | 224,197 |
| 48 | Alaska | 710,231 | 3 | 236,744 |
| 44 | Rhode Island | 1,052,567 | 4 | 263,142 |
| 47 | South Dakota | 814,180 | 3 | 271,393 |
| 46 | Delaware | 897,934 | 3 | 299,311 |
| 43 | New Hampshire | 1,316,470 | 4 | 329,118 |
| 45 | Montana | 989,415 | 3 | 329,805 |
And the worst deal
| Size Rank | State | 2010 Population per Census | Electoral Delegates | # Represented per Delegate |
| 1 | California | 37,253,956 | 55 | 677,345 |
| 3 | New York | 19,378,102 | 29 | 668,210 |
| 2 | Texas | 25,145,561 | 38 | 661,725 |
| 4 | Florida | 18,801,310 | 29 | 648,321 |
| 5 | Illinois | 12,830,632 | 20 | 641,532 |
| 7 | Ohio | 11,536,504 | 18 | 640,917 |
| 10 | North Carolina | 9,535,483 | 15 | 635,699 |
| 6 | Pennsylvania | 12,702,379 | 20 | 635,119 |
| 11 | New Jersey | 8,791,894 | 14 | 627,992 |
| 8 | Michigan | 9,883,640 | 16 | 617,728 |
Divide by Zero Error
None of which speak to the almost five million people who are unrepresented in the Legislature. Or the just short of one million people who aren’t even represented in the Electoral College.
| Size Rank | State | 2010 Population per Census | Reps | # Represented per Rep | Senators | # Represented per Senator | Electoral Delegates | # Represented per Delegate |
| 29 | Puerto Rico | 3,725,789 | 0 | #DIV/0! | 0 | #DIV/0! | 0 | #DIV/0! |
| 51 | District of Columbia | 601,723 | 0 | #DIV/0! | 0 | #DIV/0! | 3 | 200,574 |
| 53 | Guam | 159,358 | 0 | #DIV/0! | 0 | #DIV/0! | 0 | #DIV/0! |
| 54 | U.S. Virgin Islands | 106,405 | 0 | #DIV/0! | 0 | #DIV/0! | 0 | #DIV/0! |
| 56 | Northern Mariana Islands | 53,883 | 0 | #DIV/0! | 0 | #DIV/0! | 0 | #DIV/0! |
| 55 | American Samoa | 55,519 | 0 | #DIV/0! | 0 | #DIV/0! | 0 | #DIV/0! |
And the spreadsheet, in case it’s useful to someone else.


