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
""" | |
Gist made by Kshitij Chawla (Github name: kchawla-pi) for the Nilearn library in Feb/March 2019. | |
GPLv3 | |
""" | |
def replace_parameters(replacement_params, | |
end_version='future', | |
lib_name='Nilearn', | |
): | |
""" |
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
import pathlib | |
import sys | |
import sh | |
def clone_if_not_exists(name, url, **kwargs): | |
if not pathlib.Path(name).exists(): | |
print("Cloning", url, "...") | |
sh.git.clone(url, name, depth=1, **kwargs) |
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
''' | |
This is an example of the server-side logic to handle slash commands in | |
Python with Flask. | |
Detailed documentation of Slack slash commands: | |
https://api.slack.com/slash-commands | |
Slash commands style guide: | |
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
''' |
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 python | |
# | |
# clock_skew.py | |
# This script reads json data from /tmp/sigsci-agents.json | |
# and prints a message if an agent's clock skew is greater | |
# or equal to the defined thresholds. | |
# | |
# SigSciApiPy (https://github.com/signalsciences/SigSciApiPy) is | |
# an easy way to pull agent data from the Signal Sciences API and | |
# save it to /tmp/sigsci-agents.json |
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 bash | |
# clock_skew.sh - Check remote hosts for clock skew (time drift), and | |
# output a warning or alert message based on defined thresholds. | |
# | |
# Instructions: | |
# Create a hosts.txt file that contains the list of hosts to be checked. | |
# | |
# hosts.txt should contain one host entry per line, and username and | |
# port fields are optional. Format: | |
# |
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
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this: | |
[Colors] | |
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', |
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
# Create background noise profile from mp3 | |
/usr/bin/sox noise.mp3 -n noiseprof noise.prof | |
# Remove noise from mp3 using profile | |
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21 | |
# Remove silence from mp3 | |
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5% | |
# Remove noise and silence in a single command |
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 python | |
# | |
# Send/receive UDP multicast packets. | |
# Requires that your OS kernel supports IP multicast. | |
# | |
# Usage: | |
# mcast -s (sender, IPv4) | |
# mcast -s -6 (sender, IPv6) | |
# mcast (receivers, IPv4) | |
# mcast -6 (receivers, IPv6) |
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 python | |
# encoding: utf-8 | |
from twill import * | |
import urllib2,re | |
USERNAME = 'YOUR USERNAME' | |
PASSWORD = 'YOUR PASSWORD' | |