Skip to content

Instantly share code, notes, and snippets.

View ubuntupunk's full-sized avatar
:octocat:
making coffee

DavDev Yes ubuntupunk

:octocat:
making coffee
View GitHub Profile
@ubuntupunk
ubuntupunk / gist:9ee38cfe7e21a505985861fc50be8a3a
Created September 24, 2024 10:34
prune accidental key committed to repo
$ mkdir repo_cleanup
$ cd repo_cleanup
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY .
$ git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch key.txt" \
--prune-empty --tag-name-filter cat -- --all
$ echo "key.txt" >> .gitignore
$ git add .gitignore
$ git commit -m "Add key.txt to .gitignore"
$ git push origin --force --all
#!/bin/sh
USER=my-user
HOST=my-server.com
DIR=my/directory/to/topologix.fr/ # the directory where your web site files should go
hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR} # this will delete everything on the server that's not in the local public folder
exit 0
@ubuntupunk
ubuntupunk / 1634579671.txt
Created October 18, 2021 17:54
Created with Copy to Gist
sudo python3 -m pip install --upgrade requests
"""
@Will Reynolds 2018
this is a financial data gathering and manipulation program.
"""
# import libraries
# you must have the following packages installed to run the program
import requests
@ubuntupunk
ubuntupunk / YahooFinance.js
Created July 5, 2021 12:02 — forked from mikaelz/YahooFinance.js
Google script to fetch stock quote data from Yahoo Finance
function YahooFinance(ticker) {
var ticker = ticker || "GOOG";
ticker = encodeURI(ticker);
var response = UrlFetchApp.fetch("https://query2.finance.yahoo.com/v7/finance/options/" + ticker);
var chain = JSON.parse(response.getContentText());
return parseFloat(chain.optionChain.result[0].quote.regularMarketPrice);
}
@ubuntupunk
ubuntupunk / 1607851494.txt
Created December 13, 2020 09:24
Created with Copy to Gist
Hi
You need to
1) go to wp-admin settings> general
2)WordPress Address (URL) and Site Address (URL) add www to both
3)try to connect jetpack again
4)when finished remove www again if you want
@ubuntupunk
ubuntupunk / 1604308232.txt
Created November 2, 2020 09:10
Created with Copy to Gist
find . -iname "*png" -print0 | xargs -r0 --max-procs=4 -n1 sh -c 'pngnq -s1 "$1" && advpng -z -4 -q "${1%.*}"-nq8.png' -
@ubuntupunk
ubuntupunk / 1604308221.txt
Created November 2, 2020 09:10
Created with Copy to Gist
pngnq -s1 image.png && advpng -z -4 -q image-nq8.png
@ubuntupunk
ubuntupunk / 1603807964.txt
Created October 27, 2020 14:12
Created with Copy to Gist
viman () { text=$(man "$@") && echo "$text" | vim -R +":set ft=man" - ; }
@ubuntupunk
ubuntupunk / 1603620549.txt
Created October 25, 2020 10:09
Created with Copy to Gist
You can make urxvt copy to both Primary and Clipboard with the selection-to-clipboard perl extenion. This keeps them in sync, so you just copy once in urxvt and it should work in applications that use either.
URxvt.perl-ext-common: selection-to-clipboard