Skip to content

Instantly share code, notes, and snippets.

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

Talles Airan tallesairan

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://www.youtube.com/iframe_api"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
@tallesairan
tallesairan / Ajax snippet
Created May 15, 2015 18:47
Snippet ajax
$('.btn-evento a').click(function(event) {
event.preventDefault();
$.ajax(this.href, {
dataType: 'html',
success: function(data) {
$('.galeriazoeira').html(data);
//$('.galeriazoeira').text('The page has been successfully loaded');
},
error: function() {
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'),
local('OpenSans-Italic'),
url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
}
@font-face {
font-family: 'Open Sans';
#######################################################################
# OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ #
# For more information please visit http://oneinstack.com #
#######################################################################
Do you want to setup SSL under Nginx? [y/n]: n
Please input domain(example: www.linuxeye.com): talles.org
domain=talles.org
@tallesairan
tallesairan / Facebook Ips
Created July 2, 2017 21:52
Facebook ips 02/07/2017
204.15.20.0/22
69.63.176.0/20
66.220.144.0/20
66.220.144.0/21
69.63.184.0/21
69.63.176.0/21
74.119.76.0/22
69.171.255.0/24
173.252.64.0/18
69.171.224.0/19
@tallesairan
tallesairan / deletes.sh
Created October 4, 2017 17:16
Delete all files recursively with name on unix systems
find / -name .DS_Store -print0 | xargs -0 rm -rf
@tallesairan
tallesairan / yum.sh
Last active October 4, 2017 17:19
restore centos to inital install
If everything was installed via the yum package manager, you can undo previous commands:
# Get all yum commands previously run
yum history list all
# Get the details of the command
yum history info [entry number]
# Undo each command top-down
yum history undo [entry number]
@tallesairan
tallesairan / pid.md
Last active April 7, 2023 12:05
get pid by port on unix

On Linux, you must be root or the other user to get process information for processes running as other users, so prepending sudo is most of what you need. In addition to that, on modern Linux systems, ss is tool to use to do this:

$ sudo ss -lptn 'sport = :80'

State Local Address:Port Peer Address:Port
LISTEN 127.0.0.1:80 : users:(("nginx",pid=125004,fd=12)) LISTEN ::1:80 :::* users:(("nginx",pid=125004,fd=11))

@tallesairan
tallesairan / Login.php
Created October 10, 2017 12:29
Login on centos, using unix user and password on php
<?php
class Login{
static function authenticate($user, $pass){
$shad = preg_split("/[$:]/",`cat /etc/shadow | grep "^$user\:"`);
$mkps = preg_split("/[$:]/",trim(`mkpasswd -m sha-512 $pass $shad[3]`));
return ($shad[4] == $mkps[3]);
}
public function handleAuth($user,$pass){
return $this->authenticate($user,$pass);
@tallesairan
tallesairan / copySite.sh
Created October 17, 2017 11:35
copy all site entire with wget
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://sitetocopy.com