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
#!/bin/bash | |
# Mixing in python with bash we can easily retrieve our passwords securely in our shell scripts. | |
# Read this first: https://live.gnome.org/GnomeKeyring/SecurityPhilosophy | |
# Make sure your distro has gnome-keyring-daemon installed and running at login, | |
# as well as python-keyring installed (sudo apt-get install python-keyring) | |
## | |
# Follow these steps to see what it does. Verify by looking in Seahorse for your password. | |
## |
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
function convertMiliseconds(miliseconds, format) { | |
var days, hours, minutes, seconds, total_hours, total_minutes, total_seconds; | |
total_seconds = parseInt(Math.floor(miliseconds / 1000)); | |
total_minutes = parseInt(Math.floor(total_seconds / 60)); | |
total_hours = parseInt(Math.floor(total_minutes / 60)); | |
days = parseInt(Math.floor(total_hours / 24)); | |
seconds = parseInt(total_seconds % 60); | |
minutes = parseInt(total_minutes % 60); |
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
<?php | |
function doCurl(string $url, string $type = 'GET', array $headers = [], array $post_fields = [], string $user_agent = '', string $referrer = '', bool $follow = true, bool $use_ssl = false, int $con_timeout = 10, int $timeout = 40) | |
{ | |
$crl = curl_init($url); | |
curl_setopt($crl, CURLOPT_CUSTOMREQUEST, $type); | |
curl_setopt($crl, CURLOPT_USERAGENT, $user_agent); | |
curl_setopt($crl, CURLOPT_REFERER, $referrer); | |
if ($type == 'POST') { | |
curl_setopt($crl, CURLOPT_POST, true); | |
if (!empty($post_fields)) { |