Skip to content

Instantly share code, notes, and snippets.

View rixwoodling's full-sized avatar
🤖
bleep bloop

Rix rixwoodling

🤖
bleep bloop
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<!-- Movie YEAR -->
<movie>
<title>Movie 電影</title>
<originaltitle>Movie</originaltitle>
<sorttitle>Movie</sorttitle>
<year>YEAR</year>
<set></set>
<tag></tag>
<tag></tag>
@rixwoodling
rixwoodling / cronjob.ifdownthenreboot.sh
Last active May 2, 2020 17:17
cronjob.ifdownthenreboot.sh
#!/bin/bash
x=`ping -c1 google.com 2>&1 | grep unknown`
if [ ! "$x" = "" ]; then
echo "rebooted" >> /home/$USER/admin.log
reboot
fi
#!/bin/bash
# print all arguments
function this { for i in "$@"; do echo "$i"; done }
this "$@"
@rixwoodling
rixwoodling / rename.sh
Last active October 28, 2022 21:11
easily rename files in shell
#!/bin/bash
# author: rix
# === rename v1 ===
# easily rename files in shell
# HOW TO USE
# run script without argument, or specify file*,
# the script will prompt to find: and replace:
# ./rename.sh myfile.*
# === use at your own risk ===
#!/bin/bash
# rsync backup for daily cron
rsync -avhP --delete-before rix@192.168.1.104:~/nfs/ /home/rix/srv/rsync/ --log-file=rsync.log
@rixwoodling
rixwoodling / nested_list_xy_rotate.py
Created May 8, 2024 03:25
print a nested list horizontally or vertically
#!/usr/bin/env python3
# example list
csvlist = [['ID','a','b','c','d'],[0.453,0.234,0.345,0.236,0.285],[2.344,4.234,3.345,7.346,3.757]]
# print vertical csv output
mainlist = []
x = 0
y = len(csvlist[0])
while x < y: