This file contains 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
#!/usr/bin/env python3 | |
import subprocess | |
command = "ps axo user:30,pid,pcpu,pmem,vsz,rss,tty,stat,start,time,comm" | |
l = subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8").split("\n") | |
minlen = sorted(set([30-len(item.split(" ")[0]) for item in l]))[0] | |
for line in l: | |
print(line[:30-minlen]+line[30:]) |
This file contains 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
{ | |
:local iname "ether1-WAN" | |
:local rate [/interface monitor-traffic $iname once as-value] | |
:local raterx ($rate->"rx-bits-per-second") | |
:local ratetx ($rate->"tx-bits-per-second") | |
:local type [:toarray "bps,Kbps,Mbps,Gbps"] | |
:local counter 0 |
This file contains 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
:if ([/ping 8.8.8.8 count=10 size=64 interval=2s]=0) do={ | |
:log warning "LTE DOWN"; | |
/interface disable lte1 | |
:delay 5 | |
/interface enable lte1 | |
} |
This file contains 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
# mengaktifkan fitur docker pd mikrotik, akan diminta tekan tombol mode. lalu router reboot | |
/system/device-mode/update container=yes | |
# mempersiapkan ip yg akan dipakai docker | |
/interface veth add address=192.168.2.28/27 gateway=192.168.2.1 name=linux | |
# gabung ke bridge LAN yg sdh ada | |
/interface bridge port add bridge=bridge-LAN interface=linux |
This file contains 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
[Interface] | |
PrivateKey = RandomPrivateKey | |
Address = IPV4 | |
Address = IPV6 | |
DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001 | |
MTU = 1280 | |
[Peer] | |
PublicKey = RandomPublicKey | |
AllowedIPs = 0.0.0.0/0 | |
AllowedIPs = 2000::/3 |
This file contains 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
{ | |
:put "List user yg sedang tidak login :" | |
:foreach i in=[/ppp secret find] do={ | |
:local username [/ppp secret get $i name] | |
:local hitung [:len [/ppp active find where name=$username]] | |
:if ( $hitung = 0 ) do={ | |
:put "$username" | |
} |
This file contains 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
:foreach i in=[/system scheduler find] do={ | |
:local nama [/system scheduler get $i name] | |
:local duplikat "dup_$nama" | |
/system scheduler add copy-from=$nama name=$duplikat | |
/system scheduler remove [find name=$nama] | |
/system scheduler set [find name=$duplikat] name=$nama | |
} |
This file contains 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
for i in ./*.mkv | |
do | |
a=`ffmpeg -hide_banner -i $i 2>&1 | grep Duration | cut -d ',' -f1` | |
b=$i | |
echo $a $b | |
done |
This file contains 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
{ | |
:local seed ([/certificate scep-server otp generate minutes-valid=0 as-value]->"password") | |
:local angka 0 | |
:local char | |
:for i from=1 to=([:len $seed]-1) do={ | |
:set char [:tonum [:pick $seed $i]] | |
:if ( $char > 0 ) do= { |
This file contains 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
#include <stdio.h> | |
int main(void) | |
{ | |
int n,i,j,x; | |
printf("Enter an integer: "); | |
scanf("%d", &n); | |
for(i=1;i<=n;i++) { |
NewerOlder