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
| #!/usr/bin/env python | |
| import subprocess | |
| def check(): | |
| plist = open("plist").readlines() | |
| for i in plist: | |
| if i[:1] == "#": | |
| continue | |
| cline = i.split() |
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
| #include <stdio.h> | |
| char *types[] = {"KB","MB","GB","TB","PB","EB","ZB","YB"}; | |
| void change(int *size) | |
| { | |
| int div = 1024; | |
| int i = 0; | |
| for(;i<8;i++) | |
| { | |
| *size /= div; | |
| if(*size < div) |
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" | |
| import "regexp" | |
| func main() { | |
| re := regexp.MustCompile("[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\\.[a-z]{2,}") | |
| match := re.FindStringSubmatch("this is my email info@google.com") | |
| if len(match) != 0 { | |
| fmt.Printf("Email: %s\n",match[0]) |
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
| " Default settings | |
| set number | |
| syntax enable | |
| set showmatch | |
| set encoding=utf-8 | |
| set nocompatible | |
| set paste | |
| set nowrap | |
| set tabstop=2 shiftwidth=2 | |
| set expandtab |
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
| #!/usr/bin/env python2 | |
| import urllib | |
| import json | |
| try: | |
| body = urllib.urlopen("http://ip-api.com/json").read() | |
| body = json.loads(body) | |
| print body.get('country'),"/",body.get("city") | |
| except: | |
| print("Connection failed!") |
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/sh | |
| echo $(curl -s http://ip-api.com/json | jq -r ".country,.city") |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/utsname.h> | |
| int main() { | |
| struct utsname *x = malloc(sizeof(struct utsname)); | |
| uname(x); | |
| printf("SYS NAME: %s\n", x->sysname); | |
| printf("NODE NAME: %s\n", x->nodename); | |
| printf("RELEASE: %s\n", x->release); |
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
| var receiver_email = "YOUR_EMAIL_ADDRESS"; | |
| function outputPretty(data) { | |
| body = (data['message']).toString().replace(/\r\n|\r|\n/g, "<br>"); | |
| message = "<p><b>Date Time:</b> " + (new Date()).toString() + "</p>"; | |
| message += "<p><b>Name:</b> " + data['name'] + "</p>"; | |
| message += "<p><b>Email:</b> " + data['email'] + "</p>"; | |
| message += "<p>" + body + "</p>"; | |
| return message; | |
| } |
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
| #include <stdio.h> | |
| #include <stdarg.h> | |
| double sum(int argc, ...) { | |
| va_list items; | |
| double result = 0; | |
| va_start(items, argc); | |
| for(int i=0; i<argc; i++) | |
| result += va_arg(items, double); | |
| va_end(items); |