Skip to content

Instantly share code, notes, and snippets.

View kevsersrca's full-sized avatar
🚀
Working from home

kev kevsersrca

🚀
Working from home
View GitHub Profile
@kevsersrca
kevsersrca / go snmp
Last active September 13, 2019 11:12
Golang Snmp Trials 🐰
package main
import (
"log"
"net"
"time"
"gopkg.in/errgo.v1"
"github.com/posteo/go-agentx"
@kevsersrca
kevsersrca / gist:e55bb8fa933e7665ee08e51af022aecc
Created March 1, 2018 14:48
Digitalocean droplets list
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/digitalocean/go-qemu/hypervisor"
)
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) {
@kevsersrca
kevsersrca / gist:c89b778646b2e081b07e33ca21b2396e
Created February 23, 2018 07:44
command not found hatası
export PATH=$PATH:$(go env GOPATH)/bin
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()
@kevsersrca
kevsersrca / libvirt-network-filter.xml
Created February 6, 2018 08:17 — forked from wido/libvirt-network-filter.xml
Simple Network Filter for libvirt
<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>
package main
import (
"fmt"
"regexp"
"strings"
)
func Reverse(s string) string {
runes := []rune(s)
package main
import (
"fmt"
"math/big"
)
func fibonacci(x int) *big.Int {
fibo := make(map[int]*big.Int)
for i := 0; i <= x; i++ {
@kevsersrca
kevsersrca / virt-install-centos
Created January 24, 2018 15:15 — forked from giovtorres/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@kevsersrca
kevsersrca / gist:013dec9e9aa006f31c2e6de6cfd564fd
Last active September 13, 2019 11:15
Kickstart Notes for Virtualization 😍
#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language