$ xrandr # take the name of display that you would like to turn off
$ xrandr --output <display-name> --off
#!/bin/bash | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $1 |
#!/bin/bash | |
NR_OF_MONITORS=$(xrandr -d :0 -q | grep ' connected' | wc -l) | |
if [ $NR_OF_MONITORS = "2" ]; then | |
xrandr --output DFP1 --primary | |
fi | |
# refer to https://askubuntu.com/questions/88858/how-to-only-have-one-display |
git cherry-pick
is generally used to get specific commit from one branch to another.
It can also be used to move commits from one repository to another repository.
It can be done in following ways:
$ git remote add newrepo <new-repository-link>
$ git fetch newrepo
$ git cherry-pick <commit-sha>
taken from: https://stackoverflow.com/questions/35146286/find-address-of-constant-in-go
In short: you can't.
The error message says:
cannot take the address of k There are limitations on the operand of the address operator &. Spec: Address operators:
For an operand x of type T, the address operation &x generates a pointer of type *T to x. The operand must be addressable, that is, either a variable, pointer indirection, or slice indexing operation; or a field selector of an addressable struct operand; or an array indexing operation of an addressable array. As an exception to the addressability requirement, x may also be a (possibly parenthesized) composite literal. If the evaluation of x would cause a run-time panic, then the evaluation of &x does too.
#!/bin/bash | |
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false | |
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM | |
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED | |
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32 | |
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
"github.com/caddyserver/certmagic" |
#!/bin/bash | |
files=(*.gpg) | |
# declare -p files | |
i=0 | |
while read p; do | |
printf 'Decrypting: %s with passphrase %s\n' "${files[$i]}" "$p" | |
gpg --pinentry-mode=loopback --passphrase "$p" "${files[$i]}" 2>/dev/null >test | |
((i=i+1)) |
package client | |
type Tar struct { | |
c *Client | |
} | |
// exec executes an ExecFunc using 'tar' command. | |
func (tr *Tar) exec(args ...string) ([]byte, error) { | |
return tr.c.exec("tar", args...) |
package client | |
type YoutubeDL struct { | |
c *Client | |
} | |
// exec executes an ExecFunc using 'youtube-dl'. | |
func (ytdl *YoutubeDL) exec(args ...string) ([]byte, error) { | |
return ytdl.c.exec("youtube-dl", args...) |