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
package main | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
func Reverse(s string) string { | |
runes := []rune(s) |
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
<filter name='network_filter_1' chain='ipv4' priority='-700'> | |
<uuid>64b80046-9a9d-40c2-8782-ed5878146262</uuid> | |
<rule action='drop' direction='out' priority='500'> | |
<mac match='no' srcmacaddr='52:54:00:01:ad:9d'/> | |
</rule> | |
<rule action='return' direction='out' priority='500'> | |
<ip srcipaddr='192.168.100.101'/> | |
</rule> |
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
func isInside(adress string, masks []string, timeout time.Duration, done chan net.IP) { | |
c1 := make(chan net.IP) | |
c2 := make(chan error) | |
var p net.IP | |
var err error | |
go func() { | |
ipv4 := adress | |
p = net.ParseIP(ipv4).To4() |
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
export PATH=$PATH:$(go env GOPATH)/bin |
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
public function cleanUrl($url) { | |
if (strpos($url, 'https://') > -1) { | |
$clean = array_filter(explode("https://", $url)); | |
return $this->cleanUrl($clean[1]); | |
} | |
if (strpos($url, 'http://') > -1) { | |
$clean = array_filter(explode("http://", $url)); | |
return $this->cleanUrl($clean[1]); | |
} | |
if (strpos($url, "/") > -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
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"time" | |
"github.com/digitalocean/go-qemu/hypervisor" | |
) |
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
package main | |
import ( | |
"log" | |
"net" | |
"time" | |
"gopkg.in/errgo.v1" | |
"github.com/posteo/go-agentx" |
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
# pip install pytelegrambotapi --upgrade | |
import telebot | |
bot = telebot.TeleBot("") | |
@bot.message_handler(commands=['start', 'help']) | |
def send_welcome(message): | |
if message.chat.type == "private": | |
bot.reply_to(message, str(bot.get_me())) | |
if message.chat.type == "channel": |
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
- [ sed, -i, -r, "s/PermitRootLogin prohibit-password/PermitRootLogin yes/g", /etc/ssh/sshd_config ] | |
- [ service, ssh, restart ] |
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
virsh snapshot-delete domain --metadata snapshot-name |