Keep only last n commits--
git fetch --depth=<n-1> . <branch>
# This function dumps the input stream to the path given as parameter. | |
# If PATH gets unlinked by another (cooperative) process, it creates a new file at PATH and continues dump | |
# Provide a lockfile as the 2nd positional parameter. This is needed so that another process doesn't remove PATH | |
# when it is being written to. | |
stream_dump(){ | |
declare -x path="${1}" | |
local lock="${2}" | |
local timeout="1" # Interval for polling $path | |
declare -x line |
The readline prompt [read -p] is sent to stderr | |
The prompt for interactive bash is also sent to stderr. See POSIX mandate below | |
Source : https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html | |
PS1 :: Each time an interactive shell is ready to read a command, the value of this | |
variable shall be subjected to parameter expansion and written to standard error. | |
NOTE (source- Bash reference manual): |
abs_path(){ | |
# Transforms any path, including windows paths, given as parameter, to absolute path. | |
# Expands ~, ~-, \ etc. | |
# Exitcode: 0 (output to stdout) if path exists, 1 (outout to stderr) otherwise. | |
local path="${1}" | |
# Windows to Unix path [if operand is Unix path, then wslpath outputs to stderr] | |
local buffer=$(wslpath -u "${path}" 2>/dev/null); path="${buffer:-"${path}"}" | |
eval path="${path}" # Remove backslash, Tilde expansion etc. | |
[[ "${path}" != /* ]] && path="${PWD}/${path}" |
###AnyDesk - How Enable Remote Access from ubuntu/debian terminal.
Here are the commands might be usefull in this purpose:
anydesk --get-status
: To get current status of anydesk, which might be offlien,online
or nothing.anydesk --get-id
: To get the ID that your system can be accessed by.anydesk --service
: To start anydesk service if not already running (for Linux).anydesk --restart-service
: To restart anydesk serviceanydesk --stop-service
: To stop anydesk serviceGit sees every file in your working copy as one of three things:
Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
/etc/ssh/sshd_config
file by running the command sudo vi /etc/ssh/sshd_config
and do the following
Port
to 2222 (or any other port above 1000)PasswordAuthentication
to yes. This can be changed back to no if ssh keys are setup.sudo service ssh --full-restart
/etc/ssh/sshd_conf
, set UsePrivilegeSeparation
to no
/etc/ssh/sshd_conf
, temporarily enable plaintext passwords/etc/ssh/sshd_conf
, change port (e.g. to 23) to avoid confusion with Windows SSH serversudo service ssh restart
ssh-copy-id user@server
/etc/ssh/sshd_conf
, re-disable plaintext passwordsTo fix Could not load host key ...
error:
sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |