Tech, Software, and Code How-To
Info
A collection of how-to for quick reference to stuff that I forget all the time, mainly a "I don't want to Google this"
PC/Windows
Windows Cleanup Commands
Fixing ERR_SSL_BAD_RECORD_MAC_ALERT and ERR_CONNECTION_RESET
There are a lot of solutions to this, but this one is the one that worked universally for me. I did a bunch of research on various sites about it happening to 'Killer' networking cards, but never to Mediatek. I came across this on a Microsoft forum, and it looks to have completely solved the issue. Great too, because this particular laptop does not have Wi-Fi fast enough to matter from the 9000mtu size it was trying, so it doesn't even decrease performance!
Shutdown timer
Macs
Linux
Screen Quick Reference
Basic
Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r <session_name> |
Detach a running session | screen -d <session_name> |
Kill a running session | screen -X -S [session # you want to kill] kill |
Accessing a screen that is already attached | screen -r -d [session name] |
See help | Ctrl-a ? (Lists keybindings) |
Window Management and Getting Out
All screen commands are prefixed by an escape key, by default Ctrl-a (that's Control-a, sometimes written ^a). To send a literal Ctrl-a to the programs in screen, use Ctrl-a a. This is useful when when working with screen within screen. For example Ctrl-a a n will move screen to a new window on the screen within screen.
Description | Command |
---|---|
detach | Ctrl-a d |
exit screen | Ctrl-a : quit or exit all of the programs in screen. |
force-exit screen | Ctrl-a C-\ (not recommended) |
Create new window | Ctrl-a c |
Change to last-visited active window | Ctrl-a Ctrl-a (commonly used to flip-flop between two windows) |
Change to window by number or name | Ctrl-a ' <number or title> |
Change to next window in list | Ctrl-a n or Ctrl-a <space> |
Change to previous window in list | Ctrl-a p or Ctrl-a <backspace> |
See window list | Ctrl-a " (allows you to select a window to change to) |
Show window bar | Ctrl-a w (if you don't have window bar) |
Kill current window | Ctrl-a k (not recommended) |
Kill all windows | Ctrl-a \ (not recommended) |
Rename current window | Ctrl-a A |
Enter copy mode | Ctrl-a [ or Ctrl-a <esc> (also used for viewing scrollback buffer) |
Paste | Ctrl-a ] |
Split screen
Description | Command |
---|---|
Split display horizontally | Ctrl-a S |
Split display vertically | Ctrl-a | or Ctrl-a V (for the vanilla vertical screen patch) |
Jump to next display region | Ctrl-a tab |
Remove current region | Ctrl-a X |
Remove all regions but the current one | Ctrl-a Q |
Scrolling
Description | Command |
---|---|
Enter scrolling mode | Ctrl-a esc |
Scroll Up | Ctrl-u |
Scroll Down | Ctrl-d |
Exit scrolling mode | esc esc |
This section is a contribution from: @mickpbarry
Phones
iOS texting to multiple numbers on the same contact
When texting in iOS, having two numbers on the same contact is tricky. While there is still no solution for having two people (i.e. Jim and Jim's wife) under the same contact and texting them both simultaneously, you can determine which number you sent the message to by looking at which number number says "recent". Additionally, to change which number you text to (in the case of getting a new number but want to retain text messages from the old number) simply adjust which number is first in the contact (closer to the top)
Server Setup
Process HTML as PHP on Apache
Add the following to your /etc/apache2/apache2.conf
<IfModule mime_module>
# following line will change mime type of .html file to php
# and they will be handled as such
AddType application/x-httpd-php .html
# Set handler for .html files to php-script
<FilesMatch \.html$>
SetHandler application/x-httpd-php
</FilesMatch>
</IfModule>
Code
Complete process for creating directory listings in InDesign
Creating the data source
- Take whatever large spreadsheet you have and dial it down into it's constituent parts. In the context of this project, by region (Verde Valley as the example) and by category 1 (health and medical, in this example)
- Export this into a CSV file by creating an entirely new spreadsheet with JUST this information (do any data cleanup/find and replace at this stage)
- Set the category (column) names to something that is uniquely identifiable, has no spaces, and is simple
- Change the replaceable fields to something that is uniquely identifiable for each replace function (example would be Spanish language and no Spanish language, sls and nosls)
- Using the google sheets download function and it should come out just as you need. The 'variables' you need are the column names
Steps for data merge
-
Set up the data source by clicking "add new data source"
-
Add in all of the variables (if using the template I made you dont need to do this)
-
Make the text boxt teeny so that all entries can fit on a single page (important because otherwise it will not properly merge all of the text boxes)
-
Ensure there are no other elements on the page except for the single textbox and anything found inside the parent.
-
Run data merge tool on multiple entry mode
Steps for data cleanup
Note
This was created specifically for a project I worked on at SSDC, but the logic still tracks. Replace any specific references with generalized ones.
-
Select all data boxes and use object > merge text frames. Delete whatever is in the seperator box. Merge
-
Drag text box to the bottom, then click the red plus for overset text, hold shift, and click the box in the top left of the next column. This will explode it to multiple pages all linked together.
-
Next, find and replace steps.
Info
LOCATION: N/A^n
ADDRESS: N/A^n
SERVES: N/A^n
HOURS: N/A^n
EMAIL: N/A^n
PHONE: N/A^p
-
To find and replace all of the N/A lines with nothing (removing line break) use the following with nothing at all in the change to slot
-
To replace the icons, place the icon somewhere on the page exactly as you would like it. Copy to clipboard. Then find the thing you want to replace and change it to ^c which is for clipboard. You can also get to this by doing the @ > Other > Clipboard Formatted
NPM
Navigate to folder with src folder (download from github)
Build is found in build folder
Why the fuck people use this for basic ass js I have no idea...
How to make a Google maps API key (with error fixes)
If you ever had an error about an administrator account, needing permission, or having a block with the admin console, follow the following steps. Generally only applies to enterprise customers (Gsuite/Workspace)
-
Go to https://admin.google.com
-
Click on Main Menu icon in the upper left corner -> Apps -> Additional Google Services -> Location Google Cloud Platform -> Turn it ON.
-
Refresh the whole browser -> Click on Main Menu icon in the upper left corner -> Apps -> Additional Google Services -> Location Google Cloud Platform and click on it -> A new page will be opened where on check 'Allow users to create projects' -> Save.
-
Go to your Google Console -> Click 'Create Project' or 'Select Project' button -> Create new project or select existing
-
On the project page click 'ENABLE APIS AND SERVICES' -> Type 'Places API' in the search area -> Select the first result 'Places API' and click 'ENABLE' button -> On the 'Places API' page select 'Credential' tab and 'Create credential' / 'API key' option
Code for Google Tag manager (if someone gives you just the measurement ID)
This goes in the head
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
This goes in the body