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!