- What is your favorite band?
- What is the genre of music you listen to most?
- What is your favorite pastime?
- How do you spend most of your free time?
- What is the most irksome thing in your day-to-day?
- What do you admire?
- Where do you work?
- Is there anywhere you'd rather work? Where?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for t in [ name for name,c in \ | |
inspect.getmembers(sys.modules[__name__],inspect.isclass) \ | |
if issubclass(c, MariaModel) and not c is MariaModel]: | |
try: | |
globals()[t].create_table() | |
except Exception as e: | |
print e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch | |
git rev-list --all|tail -n1|xargs git show|grep -v diff|head -n1|cut -f1-3 -d' ' | |
git rev-list HEAD -1 -- path/to/file # show commit hash of most recent revision of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /path/to/files* -mtime +5 -exec rm {} \; # delete files older than 5 days | |
find /path/to/files* -type d -mtime +5 -mindepth 1 -exec rm -r {} \; # delete folders older than 5 days | |
find ~salsa-server/.salsa.d/latest -regextype posix-egrep -regex '^TPMRO1Agile-cpdec[0-9]{3}-[0-9]{1}-[0-9]{10}-PictureDescription\.[0-9a-zA-Z]+-[0-9a-zA-Z_-]+(Response|\.txt)$' -exec cp {} /home/data/tpmdata/PD \; #find files matching regex and copy them to new folder | |
tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz # see progress when compressing large data | |
pdftotext my.pdf - | grep 'pattern' # grep in pdf | |
find /path -iname '*.pdf' -exec pdfgrep pattern {} + # another grep in pdf solution using pdfgrep | |
for i in *.txt; do content=$(<$i); echo "{\"text\": \"${content}\"}" >> texts.jsonl; done # echo all txt files into a jsonl file | |
for i in *.xml; do mv $i "${i%.xml}.txt"; done # change the extension of a bunch of files (in this case xml to txt) | |
for i in *.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'time' | |
def die(str) | |
$stderr.puts str | |
exit | |
end | |
def usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ | |
# $FreeBSD: releng/11.1/etc/rc.subr 310010 2016-12-13 04:50:45Z dteske $ | |
# | |
# Copyright (c) 1997-2004 The NetBSD Foundation, Inc. | |
# All rights reserved. | |
# | |
# This code is derived from software contributed to The NetBSD Foundation | |
# by Luke Mewburn. | |
# | |
# Redistribution and use in source and binary forms, with or without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; https://stackoverflow.com/a/7053298/1096485 | |
(defun sh-send-line-or-region (&optional step) | |
(interactive ()) | |
(let ((proc (get-process "shell")) | |
pbuf min max command) | |
(unless proc | |
(let ((currbuff (current-buffer))) | |
(shell) | |
(switch-to-buffer currbuff) |