Git Product home page Git Product logo

.bash's People

Contributors

jaymon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cod-in

.bash's Issues

Vagrant SSH connections with Parallels

I have notes on my findings in sysadmin/vagrant/parallels-configuration/_NOTES.md

The biggest problem is it seems bento boxes seem to share the same machine-id which messes up the DHCP leases that parallels gives you and puts Vagrant in a bad state. For example, I can run:

$ cat /Library/Preferences/Parallels/parallels_dhcp_leases
[vnic0]
10.211.55.3="1675109922,1800,001c42cc5e4c,ff0824450a00020000bb113754a24acdf09cbb"

But I actually have two bento 20.04 boxes up and running. And they both seem to be running, because I can talk to the db of the second box through the forwarded port, but I can't ssh into it, in fact, I can't run vagrant ssh in either of the directories and ssh into the boxes, I have to ssh into them directly:

And that's only for the first box, as far as I can tell, I can't ssh into the second box at all, it's just up and running with no way to get into it.

I need to get sshv working for parallels, basically parsing the parallels_dhcp_leases file for the ip addresses. ff0824450a00020000bb113754a24acdf09cbb doesn't seem to correspond to the box ids found running vagrant status though, so I'll have to poke around and see what I can find

Grab all open tab titles and urls and convert them to markdown

It would be kind of cool to be able to run a command that would grab all open tabs and urls and convert them to:

[<TAB TITLE>](<TAB URL>)

I could modify this applescript: Getting a text file with the url of open tabs:

tell application "Safari"

    -- Count the number of Windows
    set numWindows to number of windows


    repeat with w from 1 to numWindows

        --Count the number of Tabs
        set numTabs to number of tabs in window w

        repeat with t from 1 to numTabs

            -- Set the Tab Name and URL values
            set tabName to name of tab t of window w
            set tabURL to URL of tab t of window w

            -- Create the Tab link and write the code
            set output to output & "    <a href=\"" & tabURL & "\">" & tabName & "</a>" & linefeed as string
        end repeat
    end repeat
end tell

-- Close out the HTML document
set output to output & "</body>
" & "</html>
"

-- Write the entire HTML document to TextEdit

tell application "TextEdit"
    activate
    make new document
    set the text of the front document to output
end tell

To work with Chrome.

environ file similar to background

allow customizing the environment similar to how I set the background, so I could add an environ.sh file and it would be sourced upon entering the directory

git visit command

it will look at the .git/config and find the url and convert that to a visitable link and open it in the browser

Here's a bitbucket one:

url = [email protected]:Username/repo.git

pygrep enhancement

really all my code grep commands should read in the .gitignore file and filter results that match that file, so if I have build/ in my .gitignore then it shouldn't return any results from that directory.

status line function

there should be a generic function everytime the status line is printed that can take a path to a script from the environment and run it, this will save me the time of having to keep adding custom functions for the most part for all my hooks.

pytouch

add pytouch that will cp a template file to the current directory, so:

$ pytouch foo.py

would basically:

$ cp $TEMPLATE_FILE foo.py

directory stuff

I think the qcd command should become a little more fully featured, so:

$ qcd recent

Would display the most recent directories

$ qcd saved

Would display the ones that are explicitly saved (which is current functionality). And

$ qcd visited

would display the most visited.

So the idea would be to have qcd run every time the prompt is printed and then track the directories.

Directories could be tracked by greping for the directory in a file with format

N /path

So you would grep and cut to find N, then increment it and then append that path back on the bottom (removing it from anywhere else in the list by using grep -N). So to display the most recent you just tail the file, to display the most you just sort the file.

add a pip-update command

lots of times I want to update a module from github, and everytime I have to look up the syntax and copy paste, what I would love is a small script that will find the current module in python's site packages (or the virtual env) and load its setup.py and get the url and current version, if it is a github url it will make this request:

pip install git+https://github.com/NAME/PROJECT#egg=NAME>CURRENT_VERSION

so instead of having to look up the url (which I just had to again by the way) I could just do:

pip-update NAME

and have it do all the heavy lifting.

open a new terminal window in the current terminal window's directory

NOTE Everything below is iTerm (iTerm2) specific!

you can get close to this with this command:

$ open . -a iTerm

But it opens a new tab.

I tried Applescript:

/usr/bin/osascript \
-e 'tell application "iTerm" to activate' \
-e 'tell application "System Events" to tell process "iTerm" to keystroke "n" using command down'

But I'm getting errors like:

Not authorized to send Apple events to iTerm
Not authorized to send Apple events to System Events

I've tried to add the right permissions in the Security and Privacy settings but I can't find a way to add permissions to iTerm under the automation section.

You can also go into iTerm's profile and click "edit profile", go to the Window tab and select "Open in a new window, never in a tab" but that seems like overkill, it feels like there must be a way to tell iTerm to do this programmatically, I tried passing in various flags using open but none of them have an effect, things like:

$ open . -a iTerm --args -n

Things that might be helpful:

search:

  • iterm "Not authorized to send Apple events to System Events"
  • iterm2 open new window not tab
  • open a new iterm shell from current iterm shell
  • iterm open new window not tab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.