sudo pacman -S reflector
sudo reflector --verbose --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
sudo reflector --latest 200 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
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
Put this in "$HOME/.gitconfig" | |
[user] | |
name = Dai Maou | |
email = [email protected] | |
signingkey = [email protected] | |
[commit] | |
gpgsign = true |
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
map $remote_addr $proxy_forwarded_elem { | |
# IPv4 addresses can be sent as-is | |
~^[0-9.]+$ "for=$remote_addr"; | |
# IPv6 addresses need to be bracketed and quoted | |
~^[0-9A-Fa-f:.]+$ "for=\"[$remote_addr]\""; | |
# Unix domain socket names cannot be represented in RFC 7239 syntax | |
default "for=unknown"; | |
} |
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/bash | |
NUM_SERVERS=$1 | |
if [ -z "$NUM_SERVERS" ]; then | |
NUM_SERVERS=20 | |
fi | |
if [ ! -f "/etc/arch-release" ]; then | |
echo "This script should only run on arch linux" | |
exit 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
yay -S xfce4 xfce4-goodies xfce4-volumed-pulse xfce4-sensors-plugin-nvidia libcanberra libcanberra-pulse sound-theme-smooth |
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 | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later 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
echo "2048 64512" | sudo dd of=/proc/sys/net/ipv4/ip_local_port_range | |
echo "1" | sudo dd of=/proc/sys/net/ipv4/tcp_tw_recycle | |
echo "1" | sudo dd of=/proc/sys/net/ipv4/tcp_tw_reuse | |
echo "10" | sudo dd of=/proc/sys/net/ipv4/tcp_fin_timeout | |
echo "65536" | sudo dd of=/proc/sys/net/core/somaxconn | |
echo "65536" | sudo dd of=/proc/sys/net/ipv4/tcp_max_syn_backlog |
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
var mr = db.runCommand({"mapreduce": "collName", "map": function(){ for(var key in this){ emit(key, null); } }, "reduce": function(key, stuff){ return null; }, "out": "collName"+ "_keys" }) | |
db[mr.result].distinct("_id") |
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
[Unit] | |
Description=Kafka | |
Requires=zookeeper.service | |
After=zookeeper.service | |
[Service] | |
Type=simple | |
ExecStart=/bin/sh -c '/home/ubuntu/.kafka/bin/kafka-server-start.sh /home/ubuntu/.kafka/config/server.properties > /home/ubuntu/.kafka/kafka.log 2>&1' | |
ExecStop=/home/ubuntu/.kafka/bin/kafka-server-stop.sh | |
Restart=on-abnormal |
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/bash | |
# Get postman app | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
sudo tar -xzf postman.tar.gz -C /opt | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
#Create a Desktop Entry | |
cat > ~/.local/share/applications/postman.desktop <<EOL | |
[Desktop Entry] | |
Encoding=UTF-8 |