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
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/Utilities/ apps "[..., 'com.github.micahflee.torbrowser-launcher.settings.desktop']" | |
https://developer.gnome.org/AppFolders/ |
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 . -type f -regex '.*\.\(yml\|json\)$' -exec sed -i $'s/\r$//' '{}' \; -exec echo "Line endings changed to LF in {}" \; |
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
function MassReplace { | |
param ( | |
[Parameter(Mandatory=$true)] [string] $Path, | |
[Parameter(Mandatory=$true)] [string] $Include, | |
[Parameter(Mandatory=$true)] [string] $FindString, | |
[Parameter(Mandatory=$true)] [string] $ReplaceString | |
) | |
Get-ChildItem $Path -Include $Include -Recurse | |
| Select-String $FindString -SimpleMatch | |
| Group-Object -Property Path |
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
function Copy-Filtered { | |
param ( | |
[string] $Source, | |
[string] $Target, | |
[string[]] $Filter | |
) | |
$ResolvedSource = Resolve-Path $Source | |
$NormalizedSource = $ResolvedSource.Path.TrimEnd([IO.Path]::DirectorySeparatorChar) + [IO.Path]::DirectorySeparatorChar | |
Get-ChildItem $Source -Include $Filter -Recurse | ForEach-Object { | |
$RelativeItemSource = $_.FullName.Replace($NormalizedSource, '') |
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 | |
usage_msg="Usage: $0 ssh_address local_image_tag" | |
ssh_address=${1?$usage_msg} | |
image_name=${2?$usage_msg} | |
echo "Sending gzipped image '$image_name' to '$ssh_address' via ssh..." | |
docker image save $image_name | gzip | ssh $ssh_address 'zcat | docker image load' | |
echo "Connecting to '$ssh_address' via ssh to seamlessly deploy '$image_name'..." |
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
FROM debian:stable-slim | |
EXPOSE 22 | |
RUN apt-get update && apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd &&\ | |
sed -e 's/#PasswordAuthentication yes/PasswordAuthentication no/' \ | |
-e 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' \ | |
-e 's/#ClientAliveInterval 0/ClientAliveInterval 60/' \ | |
-i /etc/ssh/sshd_config | |
RUN useradd -m -s /bin/bash user | |
COPY authorized_keys /home/user/.ssh/authorized_keys |
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 | |
DISPLAY=:0 /usr/bin/xdotool key Ctrl+Tab |
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
$ cat /etc/security/limits.d/95-jack.conf | |
# Default limits for users of jack-audio-connection-kit | |
@jackuser - rtprio 70 | |
@jackuser - memlock 4194304 | |
@pulse-rt - rtprio 20 | |
@pulse-rt - nice -20 | |
# This applies only to console sessions. |
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 grub2-mkconfig -o "$(sudo readlink -e /etc/grub2.cfg)" |
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
new_user='' | |
user_public_key='' | |
sudo useradd -mG sudo -s /bin/bash $new_user | |
sudo passwd --delete $new_user | |
sudo mkdir /home/$new_user/.ssh | |
echo "$user_public_key" | sudo tee /home/$new_user/.ssh/authorized_keys | |
sudo chmod -v 700 /home/$new_user/.ssh | |
sudo chmod -v 600 /home/$new_user/.ssh/authorized_keys | |
sudo chown -vR $new_user:$new_user /home/$new_user/.ssh |