Skip to content

Instantly share code, notes, and snippets.

:octocat:
‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

:octocat:
‏‏‎ Eating github stars for breakfast.
Block or report user

Report or block hoto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View two-laptops-lan.sh
# Setup IPs for two laptops
PC1 (master0
IP - 192.168.1.2
mask 255.255.255.0
gw - 192.168.1.2
PC2 (slave - live cd)
IP - 192.168.1.3
mask 255.255.255.0
gw - 192.168.1.3
View fedora26-install.sh
# cgdisk is graphical
sudo cgdisk /dev/sda
sgdisk -o /dev/sda
sgdisk -n 1::+256MiB -u 1:fbf5660e-0474-4361-8b8f-22d8049e6920 -t 1:EF00 /dev/sda
sgdisk -n 2::+1024MiB -u 2:05ee6a32-f7ca-4379-9ac9-80cf6c63933b -t 2:8300 /dev/sda
sgdisk -n 3::+20480MiB -u 3:c522f8fe-01ee-433d-8642-e0c897e817aa -t 3:8304 /dev/sda
sgdisk -n 4::-9MiB -u 4:a086c08d-49f8-48ba-918d-e38d912d734b -t 3:BF01 /dev/sda
sgdisk -n 9::+8MiB -u 9:c3935f60-0315-427c-ac5b-db1808a72112 -t 3:BF07 /dev/sda
dd if=/dev/urandom of=/dev/sda3 bs=1MiB count=10
View ack-for-certain-file-names.sh
find . -name '.gitlab-ci.yml' | ack -x -A 4 dependencies
View format-pendrive.sh
# prepares pendirve so i can install bootable os iso on it
umount
umount /dev/sdb1
dd if=/dev/zero of=/dev/sdb bs=1M count=10
cgdisk /dev/sdb
View gitlab-avatars.sh
for folder in $(ls); \
do CURRENT=$(ls ./$folder/) && echo CURRENT=$CURRENT && cp /avatars/blue/$folder.png ./$folder/$CURRENT; done
for name in $(seq 1 1000); \
do echo name=$name && wget --quiet -O $name.svg "http://tinygraphs.com/isogrids/$name?theme=seascape&numcolors=4&size=240&fmt=svg" & done
for name in $(seq 1 1000); \
do echo name=$name && inkscape -z -e $name.png -w 240 -h 240 $name.svg; done
@hoto
hoto / systemd-prblm.service
Created Jun 27, 2017 — forked from nickjacob/systemd-prblm.service
execute arbitrary bash code/variable substitution in systemd units
View systemd-prblm.service
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/ech "2 + 2 = ${MYVAR}"
@hoto
hoto / docker-stats.sh
Created Jun 22, 2017
docker stats (cpu, memory) with container names
View docker-stats.sh
docker stats $(docker ps --format '{{.Names}}')
@hoto
hoto / add-forward-agent-to-ssh-config.sh
Created Jun 13, 2017
add forward agent to ssh config
View add-forward-agent-to-ssh-config.sh
for ip in $(fleetctl list-machines | cut -f 2); \
do \
ssh core@$ip \
bash -c "\
hostname && \
echo -e 'Host * \n ForwardAgent yes\n StrictHostKeyChecking no' > ~/.ssh/config && \
cat ~/.ssh/config"; \
done
@hoto
hoto / copy-file-remotely.sh
Created Jun 11, 2017
copy text file to remote server over ssh
View copy-file-remotely.sh
cat file.txt | ssh develop "cat >> /tmp/file.txt"
@hoto
hoto / ansible_append_line.yml
Created Jun 7, 2017
append line in file using ansible
View ansible_append_line.yml
- name: kernel and python-chardet updates are disabled
replace:
path: /etc/dnf/dnf.conf
regexp: '(\s+exclude=.*)$'
replace: '\1 kernel* python-chardet'
become: yes
You can’t perform that action at this time.