# Connectiong by SSH from Android Termux to Desktop and vice-versa.md
# Copyright (c) 2019 Evandro Coan
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
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 | |
# Author: rakibfiha | |
# Usage: Save it to $HOME/.local/bin/docker and add this path to your $PATH | |
# ENV: DOCKER_RUNTIME=podman|colima-containerd; Default: colima-containerd | |
# For colima: colima start --runtime containerd | |
# For podman: podman machine init && podman machine start and set DOCKER_RUNTIME=podman | |
# For docker: set DOCKER_RUNTIME=full/path/to/docker/executable | |
runtime_exists() { |
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
## bash: keep longer history | |
sed -i 's/^HISTSIZE=1000$/HISTSIZE=10000/' ~/.bashrc | |
sed -i 's/^HISTFILESIZE=2000$/HISTFILESIZE=20000/' ~/.bashrc | |
## Enable search through history with PgUp/PgDn | |
cat > ~/.inputrc << 'EOF' | |
$include /etc/inputrc | |
# alternate mappings for "page up" and "page down" to search the history | |
"\e[5~": history-search-backward |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/bionic64" | |
config.vm.provider :virtualbox do |v| | |
v.gui = true | |
v.memory = 2048 | |
end | |
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"` | |
# to make synced folder works. |
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
SELECT | |
ROUND((input_value - output_value)/ size, 0) AS fees_per_byte, | |
COUNT(*) AS txn_cnt | |
FROM | |
`bigquery-public-data.crypto_bitcoin.transactions` | |
WHERE TRUE | |
AND block_timestamp >= '2018-01-01' | |
AND is_coinbase IS FALSE | |
GROUP BY 1 |
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
sudo cp $HOME/.local/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/org.gnome.shell.extensions.user-theme.gschema.xml /usr/share/glib-2.0/schemas && sudo glib-compile-schemas /usr/share/glib-2.0/schemas | |
# One liner fix that shouldn't be necessary |
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
public class Constants { | |
/** | |
* Contains the path to your Lambda function code. | |
*/ | |
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT"); | |
/** | |
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function: | |
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10 |
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
// find element without pair in array | |
def solution(A): | |
A.sort() | |
for index in range(0,len(A),2): | |
if A[index] != A[index+1]: | |
return A[index] | |
B = [5,6,2,9,2,3,6,7,3,1,7,9,1] | |
print(solution(B)) |
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
.PHONY: clean-pyc clean-build docs clean | |
define BROWSER_PYSCRIPT | |
import os, webbrowser, sys | |
try: | |
from urllib import pathname2url | |
except: | |
from urllib.request import pathname2url | |
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) | |
endef |
NewerOlder