This is a collection of basic "recipes", many using twurl (the Swiss Army Knife for the Twitter API!) and jq to query the Twitter API and format the results. Also, some scripts to test or automate common actions.
# Obtain the label of a given class (:class1). | |
SELECT DISTINCT ?c (STR(?l) AS ?lb) | |
WHERE { | |
?c a :class1 ; | |
<http://www.w3.org/2000/01/rdf-schema#label> ?l . | |
} | |
# Obtain a list of classes. | |
SELECT DISTINCT ?c | |
WHERE { |
def multireplace(string, replacements, ignore_case=False): | |
""" | |
Given a string and a replacement map, it returns the replaced string. | |
:param str string: string to execute replacements on | |
:param dict replacements: replacement dictionary {value to find: value to replace} | |
:param bool ignore_case: whether the match should be case insensitive | |
:rtype: str | |
""" |
This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).
The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.
Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se
# allow `mount` cmd without password | |
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo') | |
# add the mount directive to `fstab` | |
sudo mkdir -p /c | |
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab" | |
# update to `.bashrc` to auto mount at login | |
echo "sudo mount -a" >> ~/.bashrc | |
# now reload it | |
source ~/.bashrc |
CREATE TABLE states_raw( | |
d date, | |
uid UInt64, | |
first_name String, | |
last_name String, | |
modification_timestamp_mcs DateTime64(3) default now64(3) | |
) ENGINE = Null; | |
CREATE TABLE final_states_by_month( | |
d date, |
location: | |
source_directories: | |
- /etc | |
- /var/www | |
one_file_system: true | |
repositories: | |
- [email protected]:backup | |
exclude_patterns: |
If you have a list of edge hashes produced by AFL (e.g. from something like this): | |
./afl-showmap -o foo.edges -t 500 -q -e -- ./program arg1 | |
Re-run the program using gdb to trace the sequence of block IDs: | |
./collect_coverage.sh trace.txt ./program arg1 | |
Print edges in the trace: |