Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (c) 2016 Ming Qin (覃明) <https://github.com/QinMing> | |
# Open source under MIT LICENSE. | |
# You are more than welcome to come together and make this better. | |
ve() { | |
# Change path here, or add it as environment variable | |
if [ ! -n "$VENV_ROOT" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ~/.macos — https://mths.be/macos | |
# Original by Mathias Bynes | |
# Forked by Eddy Yousef | |
# Close any open System Preferences panes, to prevent them from overriding | |
# settings we’re about to change | |
osascript -e 'tell application "System Preferences" to quit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Download a specific folder from a github repo: | |
gitget.py https://github.com/divs1210/kilvish/tree/master/examples/bricksnball | |
""" | |
__author__ = 'Divyansh Prakash' | |
import sys | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: sh -*- | |
# vim: syn=sh | |
# check to make sure virtualenv installed | |
if ! command which -s virtualenv; then | |
>&2 echo "You don't have virtualenv installed in your path. To install it:" | |
>&2 echo "pip install virtualenv" | |
return 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
save-tabs () { | |
local dest="${1:-$HOME/tabs.html}" | |
local SAVE_TABS=$(cat <<EOS | |
set text item delimiters to linefeed | |
tell application "Google Chrome" to set taburls to URL of tabs of window 1 as text | |
set urls to every text item of taburls | |
set filename to (choose file name with prompt "Save Tab Set" default name "tabs.html" default location path to desktop) | |
try | |
set tabfile to open for access file filename with write permission |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
A cat
clone with syntax highlighting and Git integration.
OlderNewer