w
: show who is logged on and what they are doingwho
: show who is logged ontty
: show current users pseudo terminalps -ft pts/1
: get process id for the pseudo terminalpkill
: signal process based on name and other attributes
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
#!/bin/bash | |
UPDATES=`yum check-update -q | awk '{print $1}'` | |
COUNT=`printf "%s\n" "$UPDATES" | grep -v "^$" | wc -l` | |
YUM=`printf "%s\n" "$UPDATES" | grep -v "^$" | grep yum` | |
echo '--------------------------------------------------------------------------------' | |
echo " Weekly Update Notification for `hostname`" | |
echo " -> $COUNT update(s) available" | |
if [ -n "$YUM" ]; then | |
echo ' -> IMPORTANT: A Yum update is available. Perform this separately and first.' | |
fi |
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
#!/bin/bash | |
# This is a simple script that takes some files as arguments and sends them to a special chat | |
# Just create a new bot at @BotFather and get your chat ID from @myidbot and enter them here | |
# You can also make a shortcut in '~/.bashrc' like "alias tg='bash /opt/scripts/tg.sh'" | |
# After that restart bash and use it like 'tg file1.txt file2.jpg' | |
# EDIT TOKEN and CHAT_ID: | |
TOKEN="TOKEN" | |
CHAT_ID="12341234" | |
# Make sure curl is installed | |
for arg in "$@" |
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
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<style> | |
html body {width: 100%;height: 100%;padding: 0px;margin: 0px;overflow: hidden;font-family: arial;font-size: 10px;color: #6e6e6e;background-color: #000;} #preview-frame {width: 100%;background-color: #fff;}</style> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
//function to fix height of iframe! | |
var calcHeight = function() { |
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
# by: apolzek | |
md5sum * | sort -n > .file | |
filename='.file' | |
n=1 | |
x=1 | |
while read line; do | |
current_hash=$(echo $line | awk {'print $1'}) | |
echo "[debugging] current_hash: $current_hash" | |
x=$(($n + 1)) |
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
// ==UserScript== | |
// @name BlockBlockAdBlock | |
// @namespace http://github.com/anka-213 | |
// @version 0.1.1 | |
// @description Block the BlockAdBlock script | |
// @author Andreas Källberg | |
// @match http://blockadblock.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== |
git clone https://github.com/certbot/certbot /opt/letsencrypt
ln -s /opt/letsencrypt/certbot-auto /usr/bin/certbot
certbot certonly --expand --agree-tos --text --non-interactive \
--standalone \
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
<?php | |
function validaCPF($cpf = null) | |
{ | |
// Verifica se um número foi informado | |
if (empty($cpf)) { | |
return false; | |
} | |
// Elimina possivel mascara | |
$cpf = preg_replace('/[^0-9]/', '', $cpf); |
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
<?php | |
// PHP Máscara CNPJ, CPF, Data e qualquer outra coisa | |
// http://blog.clares.com.br/php-mascara-cnpj-cpf-data-e-qualquer-outra-coisa/ | |
// ver em funcionamento ~~> https://ideone.com/wP7zN2 | |
function mask($val, $mask) | |
{ | |
$maskared = ''; | |
$k = 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
<?php | |
// veja em funcionamento ~~> https://ideone.com/IMDNHT | |
// defino a data de hoje | |
$ano = date('Y'); | |
$mes = date('m'); | |
$dia = date('d'); | |
// calculo uma senha de 6 digítos com base na data | |
$senha = substr((substr($ano, -2) * $mes * $dia * ($ano - 1900) * 6666), -6); |
NewerOlder