$ alias pp='python -mjson.tool'
$ pp mydata.json
This file contains hidden or 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 | |
# | |
# Usage: copy-to-s3.sh /full/path/to/the/file.txt /path/in/amazon/fle.txt | |
# | |
# Caveat: the path to the file in AWS needs to be URL Encoded (in case there are spaces, etc) | |
# | |
# Minimum tweak from this Gist: https://gist.github.com/chrismdp/6c6b6c825b07f680e710 | |
# | |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine |
This file contains hidden or 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
; Source code to 303 dmeo by 4mat 2020 (http://4matprojects.blogspot.com/2020/03/c64-303.html) | |
; 303 style by 4mat 2020 | |
; Type sys 49152 to play. | |
; Written using Dasm assembler. Should be mostly compatible with other assemblers except: | |
; + The processor line is probably Dasm only unless your assembler handles multiple processors. | |
; + org might be replaced by * or something else. | |
; + Some assemblers use !byte or something else instead of .byte, see your docs. | |
This file contains hidden or 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
-- | |
-- Source: https://www.thegeekstuff.com/2016/04/mysql-optimize-table/ | |
-- | |
SELECT | |
table_name | |
, round(data_length/1024/1024) as data_length_mb\ | |
, round(data_free/1024/1024) as data_free_mb | |
FROM | |
information_schema.tables |
This file contains hidden or 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 | |
if (count($argv) != 3) { | |
print("Usage: $argv[0] [domain] [csv file]\n\n"); | |
exit(0); | |
} | |
$domain = $argv[1]; | |
$csv_filename = $argv[2]; |
This file contains hidden or 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 | |
# ----------------------------------------------------------------------------------------- | |
# Check the expiration date on the SSL certificate of the given site. Usate: | |
# | |
# $ ./check-ssl-certificate-expiration.sh www.google.com | |
# | |
# 🏵 Checking SSL certificate for https://www.google.com... | |
# | |
# Expiration date: Apr 9 13:15:00 2019 GMT |
You need to have a vt340 terminal for lsix
to work. If you are in Ubuntu to:
sudo apt-get install xterm
You need to have a decent font for xterm. You can do this:
- Edit
~/.Xresources
and put this:
! Allow sixel graphics. https://github.com/hackerb9/lsix
This file contains hidden or 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
; A Mind is Born by Linus Akesson | |
; https://linusakesson.net/scene/a-mind-is-born/index.php | |
; transcribed to 64tass and further commented by J.B. Langston | |
; important locations after program is copied to zero page | |
vmptr = $cb ; video matrix | |
clock = $13 ; global clock lsb - indicates position within bar | |
clock_msb = $20 ; global clock msb - indicates bar of song | |
script = $21 ; poke table |
This file contains hidden or 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 | |
use Symfony\Component\Yaml\Yaml; | |
use Drupal\taxonomy\Entity\Term; | |
$config = Yaml::parse(file_get_contents(DRUPAL_ROOT . '/sites/default/files/import.yml')); | |
$vocabulary = $config['vocabulary']; | |
foreach($config['terms'] as $term => $kids) { | |
$parent_term = Term::create([ |
This file contains hidden or 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 | |
$cn = \Drupal\Core\Database\Database::getConnection('default', 'default'); | |
// This is prefix you want your tables to remove. | |
$prefix = 's3cr3t_'; | |
// Read all tables | |
$result = $cn->query("SHOW TABLES"); |