define network
- by defautl every subnet is private
- add NAT to public subnet
- attach IGW to public subnet
- enable auto elastic ip assignment for public subnet
| // Zed settings | |
| // | |
| // For information on how to configure Zed, see the Zed | |
| // documentation: https://zed.dev/docs/configuring-zed | |
| // | |
| // To see all of Zed's default settings without changing your | |
| // custom settings, run `zed: open default settings` from the | |
| // command palette (cmd-shift-p / ctrl-shift-p) | |
| { | |
| "assistant": { |
| #!/bin/bash | |
| printf "\033[91m⚙\033[0m ~ \033[97mTERMINAL\033[0m ~ \033[91m⚙\033[0m:\033[92mPRAY TO THE MACHINE SPIRIT!\033[0m" | |
| echo "" | |
| sleep 2 | |
| text_param="$*" | |
| tgpt -shell -y "$text_param" | |
| # install: put this file to /usr/local/bin then chmod +x machinespirit | |
| # usage: machinespirit Tell me the current time! |
| #!/bin/bash | |
| # List all exited Docker containers | |
| exited_containers=$(docker ps -a -f status=exited -q) | |
| # Iterate over each exited container ID | |
| for container_id in $exited_containers; do | |
| echo "Deleting exited container: $container_id" | |
| docker rm $container_id | |
| done |
| #!/bin/bash | |
| # Define the card and its profiles | |
| CARD="pci-0000_00_1f.3" | |
| CARD_PROFILE_1="hdmi-stereo" # Profile 1 | |
| CARD_PROFILE_2="analog-stereo" # Profile 2 | |
| CURRENT_PROFILE=$(pacmd list-sinks | awk '/^\s*\* index:/{flag=1; next} flag && /active port:/{print $NF; exit}') | |
| echo $CURRENT_PROFILE | |
| # Function to set the profile based on the argument |
| #!/bin/bash | |
| # Define the name for the virtual environment | |
| venv_name="venv" | |
| # Check if the virtual environment already exists | |
| if [ -d "$venv_name" ]; then | |
| echo "Activating existing virtual environment..." | |
| source "$venv_name/bin/activate" | |
| else |
| package org.example.inheritance; | |
| import java.lang.reflect.Field; | |
| public class Main2 { | |
| public static void main(String[] args) { | |
| Child child = new Child(); |
| Map<Integer,Integer> map = new HashMap<Integer,Integer>(); | |
| for (Integer i : arr) { | |
| // MAP COMPUTE EXAMPLE | |
| map.compute(i, (key,val) -> { | |
| if (val==null) { | |
| return 0; | |
| } else { | |
| return val+1; | |
| } |
| version: '2' | |
| services: | |
| zookeeper: | |
| image: wurstmeister/zookeeper | |
| ports: | |
| - "2181:2181" | |
| kafka: | |
| image: wurstmeister/kafka | |
| ports: |
| nginx -V 2>&1 | tr ' ' '\n' |