Skip to content

Instantly share code, notes, and snippets.

View sasukeh's full-sized avatar
🏠
Working from home

Kyohei MORIYAMA sasukeh

🏠
Working from home
View GitHub Profile

1. AzCopy を使ったバックアップ

AzCopy の Table Storage に対応したバージョンAzCopy 7.3 (https://aka.ms/downloadazcopynet) を利用することができます。

  • Table data の ダウンロード(エクスポート)
PS> AzCopy /Source:https://myaccount.table.core.windows.net/myTable/ /Dest:C:\myfolder\ /SourceKey:key
@sasukeh
sasukeh / file0.txt
Created March 6, 2018 11:55
Cloud NativeなIconを丸々ゲットする方法 ref: https://qiita.com/sasukeh/items/ef8f692a1b818f86c40f
git clone git@github.com:cncf/landscape.git
@sasukeh
sasukeh / azCommandSnipet.md
Last active January 15, 2018 14:06
az command snipet

az vm stop --no-wait --ids $(az vm list --query "[].id" -o tsv)

VMのhostname,

az vm list -d -o tsv -g cdsazurepoc2 | awk '{print $7" "$11" "$13}'

こっちのほうがかっこいい

az vm list -d --query "[].{RG:resourceGroup, VMname:name,EIP:publicIps,PIP:privateIps}" -o table |grep -i cds

こっちもいいね

[Unit]
Description = ddns update daemon
After=network.target auditd.service
[Service]
ExecStart = /usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf
#ExecReload = /usr/bin/pkill -HUP noip2
ExecStop = /usr/bin/pkill noip2
Restart = always
KillMode = process

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load

Delete all vms at once

az vm list |grep -i virtualmachines | egrep -v "typ|extension" | xargs -l | sed -e "s/id:\ //g" -e "s/,//g" | xargs -l -i az vm delete --ids {} --yes

Delete all vms at once

az vm list |grep -i virtualmachines | egrep -v "typ|extension" | xargs -l | sed -e "s/id:\ //g" -e "s/,//g" | xargs -l -i az vm delete --ids {} --yes --no-wait

show vm detail with tab seperated value

root@DESKTOP-T3RPP82:~# az vm list -o tsv -d
@sasukeh
sasukeh / Google_Japanese_input_configuration
Created April 26, 2017 09:53
Google_Japanese_input_configuration
status key command
Composition Ctrl Space IMEOff
Conversion Ctrl Space IMEOff
Composition Ctrl Space IMEOff
Conversion Ctrl Space IMEOff
Precomposition Ctrl Space IMEOff
DirectInput Ctrl Space IMEOn
DirectInput F13 IMEOn
DirectInput Hankaku/Zenkaku IMEOn
DirectInput Hiragana IMEOn
status key command
Composition Ctrl Space IMEOff
Conversion Ctrl Space IMEOff
Composition Ctrl Space IMEOff
Conversion Ctrl Space IMEOff
Precomposition Ctrl Space IMEOff
DirectInput Ctrl Space IMEOn
DirectInput F13 IMEOn
DirectInput Hankaku/Zenkaku IMEOn
DirectInput Hiragana IMEOn
@sasukeh
sasukeh / pip.conf
Created April 24, 2017 06:48
If you faced the Error message with "DEPRECATION: The default format will switch to columns in the future.". workaround is here for that.
```
mkdir $HOME/.pip
vi $HOME/.pip/pip.conf
```
Add below:
```
[global]
format = columns
```
@sasukeh
sasukeh / myip
Created April 5, 2017 06:34
how to get your ip address? the answer is right here!!!
nslookup myip.opendns.com resolver1.opendns.com