Skip to content

Instantly share code, notes, and snippets.

View richardsonlima's full-sized avatar
:octocat:
Focusing

Richardson Lima richardsonlima

:octocat:
Focusing
View GitHub Profile
# Created by Richardson Lima
# Create a file e.g: Run.bat and put this
# powershell -command "& {C:\Env\Script\WinServerReport.ps1 .\ServerList.txt}"
#
$date = Get-Date
$d = $date.day
$m = $date.month
$y = $date.year
$hoje = "$d$m$y"
#!/bin/bash
#########################################################
# This script is intended to be run like this:
#
# curl https://domain/setup.sh | sudo bash
#
#########################################################
if [ -z "$TAG" ]; then
TAG=v0.17b
#!/bin/bash
# Program information
name="Ocs_Agent_Install_Debian_Ubuntu.sh"
version="1.0.1"
releasedate="02 March 2015"
author="Richardson Lima, "
author_contact="contato@richardsonlima.com.br"
website="http://www.richardsonlima.com.br"
copyright="Copyright 2016 - ${author}, ${website}"
# Clone over GIT: git clone https://gist.github.com/e023980f6daf4adff190.git
# Find Linux accounts locked
sudo cat /etc/passwd | cut -d : -f 1 | awk '{ system("passwd -S " $0) }'|grep --color -iE 'Password locked'
# real-time countdown timer
while true; do echo -ne "`date +%H:%M:%S:%N`\r"; done
du --block-size=MiB --max-depth=1 | sort -n
# total percentage of memory use for all processes with a given name
ps -eo pmem,comm | grep java | awk '{sum+=$1} END {print sum " % of RAM"}'
# Step 1 - Exporting SecureString from Plain text
"P@ssword1" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "C:\Temp 2\Password.txt"
# Step 2 - Creating PSCredential object
$User = "MyUserName"
$File = "C:\Temp 2\Password.txt"
$MyCredential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (Get-Content $File | ConvertTo-SecureString)
# The Default Execution Policy is set to restricted, you can see it by typing:
Get-ExecutionPolicy
github-create() {
repo_name=$1
dir_name=`basename $(pwd)`
if [ "$repo_name" = "" ]; then
echo "Repo name (hit enter to use '$dir_name')?"
read repo_name
fi
export PROMPT_COMMAND='export H1="`history 1|sed -e "s/^[\ 0-9]*//; s/[\d0\d31\d34\d39\d96\d127]*//g; s/\(.\{1,50\}\).*$/\1/g"`";history -a;echo -e "sgr0\ncnorm\nrmso"|tput -S'
export PS1='\n\e[1;30m[\j:\!\e[1;30m]\e[0;36m \T \d \e[1;30m[\e[1;34m\u@\H\e[1;30m:\e[0;37m`tty 2>/dev/null` \e[0;32m+${SHLVL}\e[1;30m] \e[1;37m\w\e[0;37m\[\033]0;[ ${H1}... ] \w - \u@\H +$SHLVL @`tty 2>/dev/null` - [ `uptime` ]\007\]\n\[\]\$ '
# cat set_perms_accounts.sh
#!/bin/bash
# set -x
for user in $(cat /home/richardson/outputaccounts.txt); do echo -e '\033[1;32m [+] Setting correct permissions for user: \033[0m'$user && chown $user:mail /var/spool/mail/$user; done
#!/bin/bash
# set -x
# Program information
name="hashIdZimbra F.A.Z"
version="1.0.1"
releasedate="11 May 2016"
author="by Richardson Lima"
author_contact="contato@richardsonlima.com.br"
website="http://www.richardsonlima.com.br"
#!/usr/bin/env bash
#
# Updating to the latest version
# $HOME/to/spf13-vim/
# git pull
# vim +BundleInstall! +BundleClean +q
############################ SETUP PARAMETERS
app_name='spf13-vim'