This file contains hidden or 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
sudo date -s "$(wget -S "http://www.google.com/" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')" |
This file contains hidden or 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
Set date from the command line | |
date +%Y%m%d -s "20120418" | |
Set time from the command line | |
date +%T -s "11:14:00" | |
Set time and date from the command line | |
date -s "19 APR 2012 11:14:00" |
This file contains hidden or 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
htpasswd -Bbn user pass > auth/htpasswd | |
docker run -it -d --restart=unless-stopped \ | |
-p 5000:5000 --name registry -v "$(pwd)"/auth:/auth \ | |
-e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ | |
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd registry:2 |
This file contains hidden or 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
``` | |
adb tcpip 5555 | |
adb connect 192.168.1.2:5555 | |
adb connect 192.168.1.3:5555 | |
``` | |
adb devices -l | |
List of devices attached | |
10.111.195.156:5556 device product:1 | |
10.111.195.157:5557 device product:2 | |
list.txt |
This file contains hidden or 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
~/.ssh/config | |
Match Originalhost server-a Exec "ifconfig | grep 192.168.1" | |
Hostname 192.168.1.100 | |
User foo | |
Port 2222 | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/id_rsa | |
Host server-a | |
HostName ngrok.example.com | |
User bar |
This file contains hidden or 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
$ ./parted_mkpart_calc.sh sda | |
Using default 1 MiB default alignment in calc | |
Calculated alignment for /dev/sda (gpt) is: 2048s | |
If you would be root, you could create partition with: | |
# parted /dev/sda mkpart [name] [type] 2048s 2930276351s | |
Verify partition alignment with: | |
# parted /dev/sda align-check optimal 1 Should return: 1 aligned | |
parted /dev/sda mkpart LVM ext4 2048s 2930276351s |
This file contains hidden or 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
Go to http://jenkins.local.host/script | |
System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Ho_Chi_Minh') |
This file contains hidden or 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
cd /opt/gitlab/embedded/service/gitlab-rails/app/controllers | |
cp application_controller.rb application_controller.rb.orig | |
vim application_controller.rb | |
... | |
before_action :force_authenticated_user! | |
... | |
def force_authenticated_user!(*args) | |
if (!current_user) and (["/explore", "/help"].include?(request.path)) | |
redirect_to new_user_session_path and return | |
end |
This file contains hidden or 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
sudo apt-get install --reinstall bcmwl-kernel-source |
This file contains hidden or 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
gitlab_rails['env'] = { | |
"http_proxy" => "http://proxy.example.com:9090", | |
"https_proxy" => "http://proxy.example.com:9090" | |
# "no_proxy" => ".yourdomain.com" # Wildcard syntax if you need your internal domain to bypass proxy | |
} | |
# Needed for proxying Git clones | |
gitaly['env'] = { | |
"http_proxy" => "http://proxy.example.com:9090", | |
"https_proxy" => "http://proxy.example.com:9090", | |
"no_proxy" => "unix" # Workaround for https://gitlab.com/gitlab-org/gitaly/issues/1447 |