Monday, August 4, 2025

WSL files to and from Windows

 I recently found this useful YouTube video which seems to be questions that come up regularly as I am using Windows more and more.


How to access WSL files from windows and Windows files from WSL

https://www.youtube.com/watch?v=i547sSXhq0E


Thursday, April 3, 2025

Symlinks in Windows

I prefer the *nix environment, but let's face it; at times we have no choice on our OS.  One thing I often struggle with is creating symlinks in Windows similar to how I'd do it in *nix.  No more "ln -s ...".


This seemed helpful to do it through the command line with Admin privileges:


https://www.howtogeek.com/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/


There is another way, but I couldn't get it to work again just now.  Hence the personal note I'm making now.

New-Item -ItemType SymbolicLink -Path ".emacs" -Target D:\repos\emacs\emacs.el



Saturday, August 31, 2024

Emacs with X on Ubuntu 24.04

I am growing more and more annoyed with all these system updates breaking my usual work routines.  After updating Ubuntu of course my editor of choice no longer worked (Grr!).  

I found this blog post for installing it:

https://ubuntuhandbook.org/index.php/2023/08/gnu-emacs-29-1-ubuntu-ppa/#google_vignette

Thanks to Ji M!


P.S. Make sure you install emacs-gtk


Monday, October 10, 2022

Some useful grep tricks I keep having to look up

 As I've said, this blog is meant for things I find myself repeatedly doing.  Especially, when I am doing them on different *nix systems I end up googling and eventually finding my same references:

This stackoverflow thread tends to be my main one to use for when I need to look for files containing as specific thing in them.  For instance, I often forget the full syntax in proc means for SAS.  

So I go to my code bases and execute the following:

      find . -name "*.sas" | xargs grep "proc means" | less

I also sometimes need to find files that contain specific things in them and copy them to a specific location.  I found this stackexchange thread useful (although not totally clean yet):

      find . -name "*.sas" | xargs grep -l "proc means" | xargs cp -t ~/destination




Thursday, April 28, 2022

Sending code to debug console in Visual Studio for Python

 Similar to this advice I found on stackoverflow, I did the following to be able keyboard debug my Python code:

File > Preferences > Keyboard Shortcuts

Then in the top right there is an icon to Open Keyboard Shortcuts (JSON), in there I put:

[
    {
        "key": "shift+c",
        "command": "editor.debug.action.selectionToRepl"
    }
]

BOOM!  Now I can highlight my code, and hit Shift+c to send the snippet to the debug console.  

NOTE: I used Shift+c as it is similar to C-c C-c in Emacs, and C-c is taken in Windows for Copy.


EDIT:  Oops, I can't use capital C with this, so instead I am now using Ctrl+alt+enter

// Place your key bindings in this file to override the defaults
[
    {
        "key": "ctrl+alt+enter",
        "command": "editor.debug.action.selectionToRepl"
    }
]

Friday, April 8, 2022

View WiFi Password on Windows

Thanks to this post, I can now use the following command to view my WiFi passwords without having to repeatedly ask for them when hooking up other gadgets:


Open your command prompt with Administrator Privileges (This is necessary to see the WiFi password)

This is to see your networks you've already setup:


netsh wlan show profiles

And when you see your SSID in there, I'll call this <SSID>, then type:

netsh wlan show profile name= <SSID> key=clear

You should see your password on the Key Content line in the Security Section.

Cool!

Thursday, July 5, 2018

Emacs Keyboard Macros and Key Binding

I recently came across these two articles that I think would come in quite handy for some customization to our current Emacs configuration:

Keyboard Macros: Build custom commands with the Emacs Command Language

Mastering Key Bindings in Emacs




Wednesday, August 30, 2017

Kicking off processes from a web interface

In a previous job I had, we did a lot of work with Django as a front end for the control of our analytical system.  In the process, someone used cron to track the system frequently in order to be able to pick up toggles input through the UI.  I wasn't the biggest fan of this approach, but that's a story for another day, because the reality is that I couldn't think of a better approach.  Enter my recent discovery of Celery.  I have been wanting to try this out, because it might be exactly what I'm looking for when it comes to this, and I want to save this tutorial on just a proof of concept:


So, I'll have to have a follow-up blog with my experience with using it.

P.S. He also has a thorough Flask tutorial as well:



Wednesday, August 9, 2017

Keyword Arguments in Calculating Distance Matrix

One of the challenges I had when writing up my RREML package in R was how to handle the coordinates as a keyword argument to my rreml function.  Well, I've pretty much abandoned my R package at this point in time, and would eventually like to implement the approach in Python.  I just stumbled across this very brief Reddit discussion:


And I found the scipy documentation referred to in the response to be a great reference for how to setup my new keyword argument.

Convolution History

Back in my grad school days, one of the more useful techniques in deriving distributions was using the Convolution Operation.  I found this article extremely interesting and want to save it for future reference.

Friday, September 9, 2016

Setting anaconda as pyvenv for elpy

Per this discussion:

https://github.com/jorgenschaefer/elpy/issues/285

In order to set the elpy environment, you type:

M-x pyven-activate <path to environment (note not the bin)>

Thursday, June 2, 2016

Guest Account on Windows 10

My girlfriend's daughter absolutely loves my Surface Pro 3 (well, almost as much as me), but she recently bjorked up my whole setup.  That's on me, because I should never let someone, especially a child, have the ability to mess around with my work machine.  I just couldn't seem to find a way to create an account for her without setting up an email address.  It took me a while to find it, but I finally found the best way to create a "Guest" account Windows 10:

Create a local user account in Windows 10

Friday, May 6, 2016

symlinks in Windows 10

Once again howtogeek comes to my rescue:

mklink /prefix link_path file/folder_path

Saturday, February 20, 2016

Generating SSH Keys in PuTTY

Open the PuTTYgen file under the full PuTTY installation
Generate your key by moving mouse around in the blank area
It’s usually recommended to add the key passphrase as well. This key was only generated for this tutorial.
Save the private key within the PuTTY directory (.ppk) by clicking the button on the right






Save the public key by clicking the left button






Now open up PuTTY and load one of your saved sessions


Now go to Connection > SSH > Auth and point to the my_private_ppk file in “Private key file for authentication:”


Now go back to up to Session and save this in the configuration:


If there isn’t already a .ssh directory in your home directory on 1sample.internet.com, make one.
Now open a command prompt, and navigate to the PuTTY directory and you can execute the following command:

It can be copied and pasted here: