If this blog helped you in any way, please donate a dollar here

Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Wednesday, May 17, 2023

Share mouse keyboard between Mac and Windows without KVM

Here's a problem that really got me flustered for some time. I was using a Mac OSX Ventura (13.x) from work and also a personal Windows 11 but I wanted to use them at the same time - when I'm taking a break from work - for example. However I wasn't aware of how to get my input streamed to both of them and switch between then whenever I like. After a lot of research I was able to find something that worked and that was free and open source!

I could have bought a KVM switch, but why spend money when technology and FOSS can solve my problem.

Friday, July 7, 2017

Logging PF Firewall on Mac OSX

Steps to enable logging for pfctl utility on newer osx like Yosemite, Sierra:

Firstly,

Add "log" to all rules in "/etc/pf.conf" or which ever PF configuration file you have.

Also set the logging interface with:

set loginterface pflog0

on the top of the PF config file.

Create a virtual interface with:

sudo ifconfig pflog0 create

Now start viewing packets which match the rules you logged with this:

sudo /usr/sbin/tcpdump -lnettti pflog0

At the end do:

sudo ifconfig pflog0 create

Friday, April 28, 2017

RVM Ruby Execution with launchctl on osx

This addresses a problem that goes like this:

You want to create a launch file for launchd (launchctl) to run a ruby file periodically or as a daemon.

Various solutions to this problem include creating an RVM alias for the particular ruby version you want to use. Here I present a working version without aliases, just uses the default RVM Ruby. Please not that, for me, the default rvm ruby is 2.2.5.

When you create a sample plist file like this:



The rvm environment does get initialized. You get lots of gem issues.

The trick here lies in not running ruby but:

rvm-shebang-ruby

Simply use:

Ruby and RVM environments are now correctly updated.

Yeah and you don't need to create any aliases. It will work perfectly fine.


Thursday, November 24, 2016

Showing Images on the terminal

So I just found a post on Hacker News where someone installed FreeBSD on their Mac, apparently because of this cool terminal thingy called Terminology. It can apparently show images on the terminal, using something called the EFL (Enlightenment Foundation Libraries), which are basically a  set of graphics libraries on the Enlightenment Window Manager. Now being the lazy dude I am, I decided I am not going to spend hacking UEFI today, rather why not spend hacking iTerm instead? I know iTerm shows me beer emoji when I do brew installs.


So surely, there must be some way of showing images right?

Well here we go:


Right on! Here's the amazing script which does this: https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat

Happy Hacking!