spenibus.net
2018-04-23 20:48:09 GMT

Medal of Honor - Allied Assault War Chest - Config Notes

Mostly fixing the FOV, as always. >%gamedir%/main/configs/unnamedsoldier.cfg ```` seta r_customheight "1200" seta r_customwidth "1920" seta ui_console "1" seta developer "1" alias fovdown "fov 90" alias fovup "fov 110" bind ) "fovdown" bind = "fovup" ````
2018-03-04 19:04:57 GMT

git bash function gitnew update 2018-03-04

Previously on this topic: - [Git bash - Create remote repositories quickly on github and gitlab][1] - [git bash function gitnew version 20161021-2045, now with BitBucket][2] - [git bash function gitnew version 20161023-0057, with less redundancy][3] After migrating to my latest pc build (ryzen/vega), I realized my `gitnew` function wasn't working anymore. So here's the update: ```` gitnew() { # token path tokenPath='P:/' # name of the remote in the config remoteName='all' # remoteOrder # first is main, others are secondary # the values here are keys for remoteUrl and remoteUser remoteOrder=( 'github' 'gitlab' 'bitbucket' ) # remote urls (where to push) declare -A remoteUrl=( ['github']='git@github.com:spenibus' ['gitlab']='git@gitlab.com:spenibus' ['bitbucket']='git@bitbucket.org:spenibus' ) # remote users (who is pushing) declare -A remoteUser=( ['github']='spenibus' ['gitlab']='spenibus' ['bitbucket']='spenibus' ) ##### no config edits below this point # token folder does not exist if [ ! -d "$tokenPath" ]; then echo 'error: token folder not available' # .git subfolder does not exist elif [ ! -d ".git" ]; then echo 'error: .git folder is missing' # we got everything we need else # repo name repoName="$(basename "$PWD")" for i in "${!remoteOrder[@]}" do # get key key=${remoteOrder[$i]} # build full url urlFull="${remoteUrl[$key]}"'/'"$repoName"'.git' echo 'Adding remote url' echo " $key" echo " $urlFull" # add main url if [ "$i" = "0" ]; then echo ' [main]' git remote add "$remoteName" "$urlFull" # add secondary url else echo ' [secondary]' # avoid duplicate git remote set-url "$remoteName" --delete "$urlFull" # add git remote set-url "$remoteName" --add "$urlFull" fi done echo $'\nQuerying github\n--------------------' curl \ -H 'Authorization: token '"$(cat "$tokenPath"'github.token.txt')"\ -d '{"name":"'"$repoName"'"}' \ 'https://api.github.com/user/repos' echo $'\nQuerying gitlab\n--------------------' curl \ -H 'Private-Token: '"$(cat "$tokenPath"'gitlab.token.txt')" \ --data-urlencode 'name='"$repoName" \ --data-urlencode 'public=true' \ 'https://gitlab.com/api/v3/projects' echo $'\nQuerying bitbucket\n--------------------' curl \ -X POST \ -H 'Content-Type: application/json' \ -u "${remoteUser[bitbucket]}":"$(cat "$tokenPath"'bitbucket.token.txt')" \ -d '{"scm":"git", "has_issues":true, "has_wiki":true}' \ 'https://api.bitbucket.org/2.0/repositories/'"${remoteUser[bitbucket]}"'/'"$repoName" fi } >&2 # http://stackoverflow.com/a/31656923/3512867 # http://stackoverflow.com/a/1500592/3512867 export -f gitnew ```` End of transmission. [1]: http://spenibus.net/b/p/r/Git-bash-Create-remote-repositories-quickly-on-github-and-gitlab [2]: http://spenibus.net/b/p/A/git-bash-function-gitnew-version-20161021-2045-now-with-BitBucket [3]: http://spenibus.net/b/p/B/git-bash-function-gitnew-version-20161023-0057-with-less-redundancy
2016-10-23 01:32:41 GMT

git bash function gitnew version 20161023-0057, with less redundancy

gitnew ------ gitnew() { # token path tokenPath='P:/' # name of the remote in the config remoteName='all' # order of remote repos # first is main, others are secondary # the values here are keys for remoteUrl and remoteUser remoteOrder=( 'github' 'gitlab' 'bitbucket' ) # remote urls (where to push) declare -A remoteUrl=( ['github']='git@github.com:user' ['gitlab']='git@gitlab.com:user' ['bitbucket']='git@bitbucket.org:user' ) # remote users (who is pushing) declare -A remoteUser=( ['github']='user' ['gitlab']='user' ['bitbucket']='user' ) ##### no config edits below this point # token folder does not exist if [ ! -d "$tokenPath" ]; then echo 'error: token folder not available' # .git subfolder does not exist elif [ ! -d ".git" ]; then echo 'error: .git folder is missing' # we got everything we need else # repo name repoName="$(basename "$PWD")" for i in "${!remoteOrder[@]}" do # get key key=${remoteOrder[$i]} # build full url urlFull="${remoteUrl[$key]}"'/'"$repoName"'.git' echo 'Adding remote url' echo " $key" echo " $urlFull" # add main url if [ "$i" = "0" ]; then echo ' [main]' git remote add "$remoteName" "$urlFull" # add secondary url else echo ' [secondary]' # avoid duplicate git remote set-url "$remoteName" --delete "$urlFull" # add git remote set-url "$remoteName" --add "$urlFull" fi done echo $'\nQuerying github\n--------------------' curl \ -u "${remoteUser[github]}":"$(cat "$tokenPath"'github.token.txt')" \ -d '{"name":"'"$repoName"'"}' \ 'https://api.github.com/user/repos' echo $'\nQuerying gitlab\n--------------------' curl \ -H 'PRIVATE-TOKEN: '"$(cat "$tokenPath"'gitlab.token.txt')" \ --data-urlencode 'name='"$repoName" \ --data-urlencode 'public=true' \ 'https://gitlab.com/api/v3/projects' echo $'\nQuerying bitbucket\n--------------------' curl \ -X POST \ -H 'Content-Type: application/json' \ -u "${remoteUser[bitbucket]}":"$(cat "$tokenPath"'bitbucket.token.txt')" \ -d '{"scm":"git", "has_issues":true, "has_wiki":true}' \ 'https://api.bitbucket.org/2.0/repositories/'"${remoteUser[bitbucket]}"'/'"$repoName" fi } >&2 # http://stackoverflow.com/a/31656923/3512867 # http://stackoverflow.com/a/1500592/3512867 export -f gitnew Bonus ----- Updating multiple subfolders to add another remote storage. for i in * do if [ -d $i ]; then # enter subdir cd $i dir=$(basename "$PWD") # user feedback echo $'\n--------------------\nprocessing: '$dir $(gitnew) $(git paa) # alias of "push --all all" # exit subdir cd '..' fi done