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
| Check if empty | |
| if [ -z "$var" ] | |
| then | |
| echo "\$var is empty" | |
| else | |
| echo "\$var is NOT empty" | |
| fi | |
| OR |
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
| sudo yum install gcc-c++ make | |
| sudo curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash - | |
| sudo yum install -y nodejs | |
| curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo | |
| sudo yum install yarn |
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
| #first create the file this will make a 4gb file. do 20 count for 2gb etc.. | |
| sudo dd if=/dev/zero of=/swapfile bs=128M count=32 | |
| chmod 600 /swapfile | |
| #format the file properly with mkswap | |
| sudo mkswap /swapfile | |
| #tell your system to activate it | |
| swapon /swapfile | |
| #test swap file | |
| swapon -s | |
| #if no errors add to fstab so it auto mounts: |
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
| enable amazon-linux-extras | |
| enable epel extras | |
| adduser nginx | |
| update yum | |
| upgrade yum | |
| ##get katest nginx | |
| cd /tmp/ |
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
| escape ^Z^\ | |
| vbell off | |
| # don't show startup messages | |
| startup_message off | |
| # detach on hangup - if my dial-up session fails, screen will simply | |
| # detach and let me re re-attach later. | |
| autodetach on |
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 | |
| # simple shell script to demonstrate how EC2 Instance Connect CLI is implemented. | |
| # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html | |
| # | |
| # Usage | |
| # $ bash eic-cli.sh i-1234 | |
| if [ $# -ne 1 ]; then | |
| echo "Usage" | |
| echo "$ bash eic-cli.sh i-1234" |
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
| <div x-data="{ openTab: 1 }" class="flex flex-col-reverse"> | |
| <div class="hidden mt-6 w-full max-w-2xl mx-auto sm:block lg:max-w-none"> | |
| <div class="grid grid-cols-4 gap-6" aria-orientation="horizontal" role="tablist"> | |
| @foreach ($product->productImages as $productImage) | |
| <button x-on:click="{ openTab = {{ $loop->iteration }} }" id="tabs-1-tab-{{ $loop->iteration }}" | |
| class="relative h-24 bg-white rounded-md flex items-center justify-center text-sm font-medium uppercase text-gray-900 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring focus:ring-offset-4 focus:ring-opacity-50" | |
| aria-controls="tabs-1-panel-{{ $loop->iteration }}" | |
| :tabindex="openTab === {{ $loop->iteration }} ? 0 : -1" | |
| :aria-selected="openTab === {{ $loop->iteration }} ? 'true' : 'false'" | |
| role="tab" |
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
| // function | |
| function getYoutubeUrlId (url) { | |
| const urlObject = new URL(url); | |
| let urlOrigin = urlObject.origin; | |
| let urlPath = urlObject.pathname; | |
| // Örneğin url https://youtu.be/V-uynt7UXXI ise | |
| if (urlOrigin.search('youtu.be') > -1) { | |
| // substr yapma sebebimiz, youtube kısaltma linklerinde id path'de olur ve pathname başında "/" olur. | |
| // Örneğin "/V-uynt7UXXI" ise "V-uynt7UXXI" return eder. |
