Skip to content

Instantly share code, notes, and snippets.

@echristopherson
echristopherson / print_to_timestamped_file.ps1
Last active September 22, 2023 03:36
"Print" a file from a computer emulator by having the emulator pipe the print output to this script, which is supposed to put it in a file on the host filesystem, with a date/timestamp in its filename. The script takes one argument: the path to put the output file in.
$timeStr = $args[0] + '\' + [DateTime]::UtcNow.ToString('yyyy-MM-dd-HHmmss') + '-utc.txt'
$input |Out-File -FilePath $timeStr
[ 2021-07-09 22:00:53] [Renderer.cpp:128@initialize] Failed to select EGL configuration
Stack trace (most recent call last) in thread 118827:
#7 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#6 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fa0d1ed3292, in clone
#5 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7fa0d2243608, in
#4 Object "/snap/anbox/x2/usr/bin/anbox", at 0x56082aed7314, in emugl::Thread::thread_main(void*)
#3 Object "/snap/anbox/x2/usr/bin/anbox", at 0x56082ade3358, in RenderThread::main()
#2 Object "/snap/anbox/x2/usr/bin/anbox", at 0x56082aed2060, in renderControl_decoder_context_t::decode(void*, unsigned long, IOStream*)
#1 Object "/snap/anbox/x2/usr/bin/anbox", at 0x56082ae51562, in
#0 Object "/snap/anbox/x2/usr/bin/anbox", at 0x56082ae54429, in RendererConfigList::getPackInfo(int*, int*) const
[ 2021-07-09 21:49:38] [launch.cpp:168@operator()] Session manager is not yet running, trying to start it
[ 2021-07-09 21:49:38] [launch.cpp:117@launch_session_manager] Started session manager, will now try to connect ..
[ 2021-07-09 21:49:38] [splash_screen.cpp:55@SplashScreen] Window has no associated renderer yet, creating one ...
[ 2021-07-09 21:50:28] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files
@echristopherson
echristopherson / win_pos_test.vimrc
Last active June 16, 2020 17:44
Test ability to move to specific window in vimrc
silent belowright split file1.txt
silent belowright split file2.txt
3 wincmd w
@echristopherson
echristopherson / cVimrc
Last active March 13, 2018 16:44
Configuration for cVim Chrome extension
" Allow Ctrl+6 to be used for switching to tab 6 (native Chrome) or for Verso functionality (currently set to go to Circ Reports > View Reports) -- instead of switching between two most-recently-used tabs
unmap <C-6>
" Allow Ctrl+B to be used by Verso to go to Staff Dashboard (instead of cVim behavior of "create or toggle a bookmark for the current URL" under "Other bookmarks" in bookmarks bar
unmap <C-b>
" Allow Ctrl+F for find, even when in a text field.
iunmap <C-f>
" Allow Ctrl+B to open up the Verso menu search, even when in a text field.
iunmap <C-b>
" Unmap x (close current tab) -- I like to be able to select conversations in Gmail, thank you very much.
unmap x
2 $ brew install -vd --keep-tmp echristopherson/local/vice --HEAD --with-sdl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (echristopherson/local).
==> Updated Formulae
echristopherson/local/freeciv ✔ echristopherson/local/vice ✔
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/echristopherson/homebrew-local/vice.rb
Error: No available formula with the name "echristopherson/local/vice"
==> Searching for similarly named formulae...
16:56:21: (Libpurple: util) Response headers: 'HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Thu, 22 Sep 2016 21:56:21 GMT
Content-Type: text/xml
Content-Length: 175
Connection: close
Pragma: no-cache
Cache-Control: no-store,no-cache,must-revalidate
'
Public Sub CreateLNKFile(ByVal sShortcut As String, ByVal sFileLinkName As String)
'MsgBox "Creating shortcut to " & sFileLinkName & " at " & sShortcut & "."
Dim sh As Object
Dim link As Object
Set sh = CreateObject("WScript.Shell")
Set link = sh.CreateShortcut(sShortcut)
link.TargetPath = sFileLinkName
link.Save
End Sub
' From <http://www.cpearson.com/excel/recycle.aspx>
' VBA provides the Kill method, but that bypasses the recycle bin.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Windows API functions, constants,and types.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function SHFileOperation Lib "shell32.dll" Alias _
"SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Declare Function PathIsNetworkPath Lib "shlwapi.dll" _
Sub PasteFormulas()
'
' PasteFormulas Macro
' Paste formulas, retaining destination formatting
'
'
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub