Skip to content

Instantly share code, notes, and snippets.

mvn dependency:get -Dartifact=[GROUP_ID]:[ARTIFACT_ID]:[VERSION]
@daynok
daynok / CURL XML-RPC
Last active December 3, 2021 00:05
Curl xml-rpc request
curl -d '<?xml version="1.0"?><methodCall><methodName>Handler.Method</methodName><params><param><value>SOME_VALUE</value></param></params></methodCall>' \
protocol://host:port
@daynok
daynok / move_video.sh
Created December 29, 2020 23:51
bash script to move video files, arg1 = find src, arg2 = dest
#!/bin/sh
find $1 -type f -print0 | while read -d $'\0' file
do
# determine type
TYPE=$(echo $(file -i "$file")|cut -d : -f 2)
FOUND=$(echo $TYPE|grep -E -c "^video/[^[:space:]]{1,};[[:space:]]{1}charset=binary$")
if [ "$FOUND" = "1" ]; then
echo "cp file:$file type:$TYPE to:$2"
cp -p "$file" "$2"
fi
git log --all --grep='SOME-TICKET'
http://asciiflow.com/ (used to make ascii graphs)
Feature based development
# Three basic workflow (base, hotfix, and exclude feature)
# Base workflow
* Release is made by merging in a set of feature branches
* Release and feature branches are branched off master
* When QA passes a feature the feature is merged into release branch
@daynok
daynok / git checkout all remote branches
Last active February 19, 2020 23:22
git checkout all remote branches
git branch -r | while read remoteBranch; do git checkout --track -b "${remoteBranch/origin\//}" $remoteBranch; done
# push
git push --all <origin>
git push --tags <origin>
git diff -p -R --no-color \
| grep -E "^(diff|(old|new) mode)" --color=never \
| git apply
@daynok
daynok / ifconfig-eth0
Created May 11, 2019 19:56
network-script-template
DEVICE=eth0
BOOTPROTO=static
IPADDR=your_IP
NETMASK=your_network_mask
HWADDR=NIC_MAC_address
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no