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
** Using a shell function in your .bashrc (recommended approach):
```bash
findgrep() {
find . -type f -exec grep -l "$1" {} \;
}
```
*** Or even simpler, you can use grep -r directly (more efficient):
```bash
@ubuntupunk
ubuntupunk / gist:6fb769c6a17a461eafe2c723f99bad2e
Last active February 5, 2025 09:17
compile vim with python
./configure \--with-features=huge \
--enable-multibyte \
--enable-rubyinterp=dynamic \
--enable-pythoninterp=dynamic \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
--with-python-command=/usr/bin/python \
--enable-python3interp=dynamic \
--with-python-config-dir=/usr/lib/python3.9/config-3.9-x86_64-linux-gnu/ \
--with-python3-command=/usr/bin/python3 \
--enable-perlinterp=dynamic \
lazynvm() {
unset -f nvm node npm
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
}
nvm() {
lazynvm
nvm $@
}
@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' -