rubysecurity.org

Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive

Tag Cloud


Currently Reading

MCA Microsoft Certified Associate Azure Administrator Study Guide: Exam AZ-104
MCA Microsoft Certified Associate Azure Administrator Study Guide: Exam AZ-104
308 / 435 Pages


Latest Book Reviews

Latest Posts


April 7, 2015

Google Apps API OAuth2 shenanigans

by Alpha01

So I literally was just about to start flipping tables because I wasn’t able to get my Google Apps API OAuth2 api verification to work. I was getting the following error:

401. That’s an error.

Error: invalid_client

no support email

As the documentation describes, I created my application and enabled Calendar API access to it, and lastly setup my credentials. The problem was that I was generating my OAuth 2.0 client IDs without completing the app’s consent screen data. As soon as I specified my email address in my app’s consent screen data and regenerated new a client ID, I was able to authenticate my application. If only the Google Developer Console would’ve given a warning of some sort prior to generating a client ID, a lot of #!%6@*# moments would’ve been avoided.

Tags: [ google python ]
March 28, 2015

PF syntax check

by Alpha01

[root@freebsd10 /etc]# pfctl -nf /etc/pf.conf 
/etc/pf.conf:4: syntax error
Tags: [ freebsd pf networking ]
February 13, 2015

Restarting single network interface in FreeBSD

by Alpha01

service netif restart em0
Tags: [ freebsd networking ]
February 5, 2015

Logging your terminal output using script

by Alpha01

I remember when I first discovered the tab key autocomplete in Bash and being absolutely jollied because of it. Having just found the existence of the script utility, it feels almost identical.

script gives you the capability of logging every thing within your current shell session. In the past, I would always resort to manually copying the text output of my terminal window to a file. In some cases, I would have a really long command line session that I wanted its output saved, which resulted in the entire terminal window crashing when being manually copied due to the extremely large output buffer! Thankfully with script those problems are a thing of the past.

Example

Its usage is dead simple:

tony@alpha05:~$ script logmyshit.log
Script started, file is logmyshit.log
tony@alpha05:~$ echo "script is fucking awesome!"
script is fucking awesome!
tony@alpha05:~$ exit

Contents of logmyshit.log:

Script started on Wed 04 Feb 2015 10:15:32 PM PST
tony@alpha05:~$ echo "script is fucking awesome!"
script is fucking awesome!
tony@alpha05:~$ exit

Script done on Wed 04 Feb 2015 10:16:00 PM PST

Tags: [ bash ]
October 5, 2014

System Update using Ansible

by Alpha01

CentOS

ansible centosbox -m yum -a 'name=* state=latest'

Ubuntu

ansible debianbox -m apt -a 'update_cache=yes name=* state=latest'
Tags: [ ansible centos ubuntu ]