Sometimes, you need to quickly dump a json file into sqlite, just to run some queries on it. This is a two-step process:
cat file.json | jq -r '.data | map([.field1, .field2, .field3] | @csv)| join("\n")' > file.csv
| for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less |
| # the issue is siimple misconfigurations of gdm3 | |
| # the solution is to reinstall it, or better yet - switch to lightdm: | |
| sudo apt remove gdm3 && dpkg-reconfigure lightdm | |
| # | |
| # or reinstall gdm3, it is up to you. |
| #!/bin/bash | |
| # | |
| # based off https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ | |
| # | |
| git clone --bare [email protected]:iAnatoly/homedot.git $HOME/.cfg | |
| function config { | |
| /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
| } | |
| config checkout |
| # How to upload 501M SHA1 hashes into a SQL database | |
| # | |
| # Based on: | |
| # https://blog.netnerds.net/2015/01/powershell-high-performance-techniques-for-importing-csv-to-sql-server/ | |
| # https://gallery.technet.microsoft.com/scriptcenter/Import-Large-CSVs-into-SQL-216223d9 | |
| # | |
| # Database variables | |
| $sqlserver = "YOUR_SERVER" | |
| $database = "YOUR_DATABASE" | |
| $table = "YOUR_TABLE" |
| # override DHCP hostname assignment | |
| sudo scutil --set HostName myhostname.domain.local | |
| # tweak network | |
| cat >> /etc/sysctl.conf <<EOF | |
| # OSX default of 3 is not big enough | |
| net.inet.tcp.win_scale_factor=8 | |
| # increase OSX TCP autotuning maximums | |
| net.inet.tcp.autorcvbufmax=33554432 | |
| net.inet.tcp.autosndbufmax=33554432 |
| #!/bin/bash | |
| TARGET_FILE_NUM=10000 | |
| CURRENT_FILE_NUM=`ls -l | wc -l` | |
| FILES_TO_GENERATE=$((TARGET_FILE_NUM - CURRENT_FILE_NUM)) | |
| MAX_FILE_SIZE=8192 | |
| FILE_NAME_PREFIX="test_" | |
| if [[ $FILES_TO_GENERATE -lt 0 ]]; then | |
| echo "We already have $CURRENT_FILE_NUM files, no need to generate more" |
| ########## | |
| # Win10 Initial Setup Script | |
| # Author: Disassembler <[email protected]> | |
| # Version: 1.7, 2016-08-15 | |
| # dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
| # THIS IS A PERSONALIZED VERSION | |
| # This script leaves more MS defaults on, including MS security features. | |
| # Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
| [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("SecretMessage")) | |
| [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("U2VjcmV0TWVzc2FnZQ==")) |
| [reflection.assembly]::LoadWithPartialName("System.Web") | |
| [System.Web.Security.Membership]::GeneratePassword(32,4) |