Code Monkey home page Code Monkey logo

dotfiles's People

Contributors

funguscolander avatar

Stargazers

 avatar

Watchers

 avatar

dotfiles's Issues

Make a quick ssh key fetcher/generator

A command which fetches the public rsa key, and if there isn't one, generate it first. Octocat has an ssh-key generator here and nicksp has pretty much exactly what I'm looking for in their ssh-key binary which they clones into (but you should simlink into) ~/bin/, as seen on line 253 in their setup.sh.

The public rsa key should then be added to SSH in settings/keys following github's guide.

$ ssh-keygen -t rsa -b 4096 -C "[email protected]" seems to be the command to use according to github's other guide.

Make binary for downloading entire websites with `wget`

Use the code describes in this gist to download entire websites. Maybe call it wgetfullsite?

Possibly add --no-hsts to the command to get rid of the following error:

Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
ERROR: could not open HSTS store at '/home/$USER/.wget-hsts'. HSTS will be disabled.

This Stack Exchange Post states that HSTS is an optional security measurement of top of https. Considering the error states that it just won't apply HSTS if it cannot use it and continues with the download anyway, this is probably fine.

It would probably look something like this, except written as the long version instead of the one-liner, and with --no-hsts as described above:

# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --no-hsts --domains $site_dot_extension --no-parent $site_dot_extension

# Explained
wget \
     --recursive \ # Download the whole site.
     --page-requisites \ # Get all assets/elements (CSS/JS/images).
     --adjust-extension \ # Save files with .html on the end.
     --span-hosts \ # Include necessary assets from offsite as well.
     --convert-links \ # Update links to still work in the static version.
     --restrict-file-names=windows \ # Modify filenames to work in Windows as well.
     --no-hsts \# Disable HTTP Strict Transport Security which is an optional man-in-the-middle https security addon
     --domains yoursite.com \ # Do not follow links outside this domain.
     --no-parent \ # Don't follow links outside the directory you pass in.
         yoursite.com/whatever/path # The URL to download

Also:

--mirror instead of --recursive
Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings. It is currently equivalent to ‘-r -N -l inf --no-remove-listing’. Source

--no-clobber
Don't overwrite any existing files (used in case the download is interrupted and resumed).

--wait=1 --random-wait
Some websites block scrapers by comparing request times. This varies the wait time between requests between 0.5 and 1.5 * wait seconds. This will make wait 1 second, so betwen 0.5 and 1.5 seconds in random mode.

-e robots=off
Makes Wget actually download the entire website instead of obeying the disallowed subdirectories in robots.txt. Look here.

--user-agent=Mozilla
Pretend you're Mozilla Firefox and not Wget so some websites won't block you becuase you're a robot. (Might be necessary with -e robots=off?

Add to .bashrc_aliases from nicksp

cd() { builtin cd "$@"; ll; }               # Always list directory contents upon 'cd'
alias cd..='cd ../'                         # Go back 1 directory level (for fast typers)
alias ..='cd ../'                           # Go back 1 directory level
alias ...='cd ../../'                       # Go back 2 directory levels
alias .3='cd ../../../'                     # Go back 3 directory levels
alias .4='cd ../../../../'                  # Go back 4 directory levels
alias .5='cd ../../../../../'               # Go back 5 directory levels
alias .6='cd ../../../../../../'            # Go back 6 directory levels

Add option for Vim Fugitive's .vimrc in setup.sh

Download it and have it offline in the repo, and then add an option to use it instead of your own. If chosen, check online for an update, and if there is one then ask if you should use the updated version, otherwise (or if there is no internet connection) use the offline version.

Add Zshell configuration

Install with:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Full list of plugins in the repository.

HowToGeek says that powerlevel9k is the coolest theme, clone the repo into the oh-my-zsh folder and then enable it by adding ZSH_THEME="powerlevel9k/powerlevel9k" to the .zshrc:

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

You can customise prompt elements like this:

POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs dir rbenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(root_indicator background_jobs status load)

Full documentation also available in the repo.

Define terminal keybindings in .inputrc instead of .Xmodmap

The keybinds probably will not be used outside of the GNU Readline applications so there is no need for them to be defined session-wide (.Xmodmap is session-wide, right?). The same issue is currently present in C-Fergus/winfiles where the Windows ahk script remaps the keys globally.

Format of .inputrc keybindings can be found here.

Should .bashrc or .inputrc start with set -o vi? Or somewhere else (this sets bindings to vim instead of the default emacs).

xmodmap -pke shows current Xmodmap keybindings.

Keybinds can also be set by modifying the X keyboard.

Global gitignore will not be recognised upon definition of `$XDG_CONFIG_HOME`

$XDG_CONFIG_HOME should be defined and the location of the global git ignore changed to $XDG_CONFIG_HOME/git/ignore. According to this resource, it should be defined in ~/.profile for a user, or /etc/profile for system-wide.

Check Steve Jorgensen's answer here quite far down.

The full XDG specification can be found here, which is broken down in the Arch wiki here. These variables should only be defined in absolute paths or they will be ignored.

The Windows directory for the global git ignore is ~\git\ignore

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.