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
| # I have 3 btrfs subvolume /root, /home, /nix-store and these are used as the name suggest | |
| # Now, when i create new nixos configuration i can make a snapshot of root and home, before i switch to a new config. | |
| CURRENT_GENERATION=`readlink /nix/var/nix/profiles/system | cut -d'-' -f2`; echo Determined current generation: $CURRENT_GENERATION | |
| sudo mkdir -p /btrfs | |
| # the / is not mounted in my btrfs filesystem by default, because my filesystem root is the /root subvolume | |
| sudo mount /dev/mapper/NixOS /btrfs | |
| sudo btrfs subvolume snapshot /btrfs/root /btrfs/root-$CURRENT_GENERATION-snapshot | |
| # I also make a snapshot of home, because i use gnome or KDE, which contains a lots of config and cache, which can broke by a rollback. | |
| sudo btrfs subvolume snapshot /btrfs/home /btrfs/home-$CURRENT_GENERATION-snapshot |
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
| // This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "golang.org/x/crypto/ssh" |
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 -xe | |
| # Below command can be replaced to the required CLI, including with custom JSON output, assuming the NextToken is in the same location. | |
| AWS_CLI_COMMAND="aws elasticbeanstalk list-platform-versions --max-records 100 --query={NextToken:NextToken,PlatformARNs:PlatformSummaryList[*].PlatformArn}" | |
| OUTPUT_FILE="./output-$(date +%s)" | |
| function CLI_call() { | |
| if [ ! -v NEXT_TOKEN ]; then | |
| cli_output=$($AWS_CLI_COMMAND) | |
| else |
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
| # How to use | |
| # Add an item on zabbix-web admin | |
| # curl[example.com] | |
| # | |
| # Test command on zabbix-server | |
| # [root@zabbix /]# zabbix_get -s 192.168.20.212 -k "curl[example.com]" | |
| UserParameter=curl[*],curl -sI $1 | grep -q "HTTP/1.1 200 OK" && [[ $? == 0 ]] && echo 0 || echo 1 |
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
| [general] | |
| version = 4 | |
| name = Anet A6_settings | |
| definition = custom | |
| [metadata] | |
| setting_version = 5 | |
| type = definition_changes | |
| [values] |
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/sh | |
| rm -rf "/Applications/Adobe*" | |
| rm -rf "~/Library/Application Support/Adobe/" | |
| rm -rf "~/Library/Caches/Adobe*/" | |
| sudo rm -rf "/Applications/Utilities/Adobe*" | |
| sudo rm -rf "/Library/Application Support/Adobe/" | |
| sudo rm -rf "/Users/Shared/Adobe/" |
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
| [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] | |
| binding='<Super>Return' | |
| command='urxvtc' | |
| name='Open Terminal' | |
| [org/gnome/desktop/wm/preferences] | |
| action-middle-click-titlebar='none' | |
| mouse-button-modifier='<Super>' | |
| num-workspaces=9 |
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/sh | |
| for LOOPS in $(losetup -a | awk -F':' {'print $1'} | awk -F'/' {'print $3'}); do | |
| for LOOPPART in $(ls /dev/mapper/${LOOPS}*| awk -F'/' {'print $4'}); do | |
| dmsetup remove ${LOOPPART}; | |
| done; | |
| losetup -d /dev/${LOOPS}; | |
| done |
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
| cubes look like this: | |
| e-------f | |
| /| /| | |
| / | / | | |
| a--|----b | | |
| | g----|--h | |
| | / | / | |
| c-------d |
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
| ''' | |
| texture image path are relative to the blend file directory. run from command line like this: | |
| texture=img/2012720989_c.jpg blender -b mug.blend --python texture_change.py -F PNG -s 1 -e 1 -j 1 -t 0 -a | |
| '''' | |
| import os | |
| image_file = os.getenv('texture') | |
| if not image_file: | |
| image_file="img/2012720989_c.jpg" |