Archive for ‘CLI’ Category
Browse:
CLI »
Subcategories:

Manipulating the Clipboard from the Command Line

datePosted on 10:15, November 23rd, 2013 by Many Ayromlou

Manipulating the Clipboard from the Command Line: “Copy and Paste are absolute necessities for virtually all computer users, and if you find yourself working in the command line frequently, you’ll want to know how to manipulate the clipboard. The commands pbcopy and pbpaste do exactly what they sound like, copy and paste through the command line. They’re actually quite powerful and you’ll be sure to find them useful the next time you’re hanging out with your bash prompt.”

(Via.)

Read the rest

Streaming 1080P video using Raspberry Pi (or BeagleBone Black)

datePosted on 21:24, November 9th, 2013 by Many Ayromlou

I’ve finally got this project to a point were I can do a write up on it. The following hardware is needed:

  1. Raspberry Pi 512K version (or BeagleBone Black)
  2. Logitech C920 Webcam
  3. 16 GB micro SDHC card (can probably do it on 8GB too)
  4. Wireless dongle supported by linux (I’m using a TrendNet TEW-645UB which was pretty much plug and play)

The goal of this project is to get the following installed and configured:

  1. CRTMP streaming server
  2. C920 install and config (v4l2), ffmpeg installation, boneCV installation from Derek Molloy’s site
  3. configuring ddclient for dynamic DNS (optional)
  4. putting it all together and creating a webpage with embedded JWplayer to view the stream

UPDATE: Sound works now on BeagleBone Black. On Raspberry you will run into alsa buffer xruns.Read the rest

After battling this for about a week I think I’ve got it figured out. You can install all the required packages and get everything to talk to your license server from command line. BTW, before I start, you need to have a functional license server otherwise you can stop reading now. I’m gonna use licserver.com as the domain name of mine, so substitute your DNS name where necessary. Before we start you need to figure out your product codes from the table at the following address:

http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=21481916&linkID=12305695

My products are Maya (657F1), Mudbox (498F1) and my Suite number for ECSU is 793F1. You’ll need these later. Also my base directory (current directory) in these commands is “MacOSX”, there are separate folders for the individual ECSU apps under this folder.… Read the rest

Copying large number of files between two Unix/Linux/OSX Servers

datePosted on 14:38, August 15th, 2012 by Many Ayromlou

Here are some quick tip(s) for copying a ton of files between unixy machines really fast. You’re probably thinking “why not use rsync?”…..well rsync can be miserably slow if your source or destination cpu is underpowered. You can always do a rsync after these commands to make 100% certain that everything checks out, but try using one of these methods for the initial copy:

  • One way of doing it is
    tar -c /path/to/dir | ssh user@remote_server 'tar -xpvf - -C /absolute/path/to/remotedir'

    You’ll be prompted for the remote servers password or you can use the private key of the remote server using the -i switch in the ssh command. This has the side benefit of preserving permissions. An alternate version of this command can also be used to locally move folder structures across mount points while preserving permissions: 

    tar -cf - -C srcdir .
Read the rest

Flush DNS cache in Lion and Mountain Lion

datePosted on 21:11, August 8th, 2012 by Many Ayromlou

Flush DNS cache in Lion and Mountain Lion:

To flush the DNS cache in Mac OS X 10.5 and 10.6, run this command in Terminal: 

sudo dscacheutil -flushcache 

To do the same in 10.7 and 10.8, run this command: 

sudo killall -HUP mDNSResponder 

(Via MacOSXHints.com)

CLI commands that let you access meta data of all files in OSX

datePosted on 14:29, July 31st, 2012 by Many Ayromlou

Two small commands with huge possibilities:

  1. mdls 
    usage: mdls [-name attr] [-raw [-nullMarker markerString]] [-plist file] path
    list the values of one or all the attributes of the specified file
    -raw: don't print attribute names before values
    -nullMarker: substitute this string for null attributes in raw mode
    -plist: output attributes in XML format to file. Use - to write to stdout
    option -plist is incompatible with options -raw, -nullMarker, and -name
    example: mdls ~/Pictures/Birthday.jpg
    example: mdls -name Keyword ~/Pictures/Birthday.jpg
  2. mdfind
    Usage: mdfind [-live] [-count] [-onlyin directory] [-name fileName | -s smartFolderName | query]
    list the files matching the query
    query can be an expression or a sequence of words
    
    	-live             Query should stay active
    	-count            Query only reports matching items count
    	-onlyin <dir>     Search only within given directory
    	-name <name>      Search on file name only
    	-s <name>         Show contents of smart folder <name>
    	-0                Use NUL (``\0'') as a path separator, for use with xargs -0.
Read the rest

As pointed out to me in the comments the original Author — Mathias Bynens — is constantly updating this document. You can find the latest up to date version at http://mths.be/osx

# ~/.osx — http://mths.be/osx

###############################################################################
# General UI/UX #
###############################################################################

# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"

# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false

# Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"

# Menu bar: hide the useless Time Machine and Volume icons
defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Clock.menu"

# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"

# Disable smooth scrolling
# (Uncomment if you’re on an older Mac that messes up the animation)
#defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false

# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false

# Display ASCII control characters using caret notation in standard text views
# Try e.g.
Read the rest

SSH to your remote machine using Back to My Mac iCloud Service

datePosted on 14:14, July 27th, 2012 by Many Ayromlou

This is kinda cool. It only works if you have access to “Back to My Mac” service and you have it turned on in the remote mac’s preferences (under iCloud preferences). If you ever need to find out the FQDN (Fully Qualified Domain Name) of your remote mac and connect to it via ssh or something like it you can use the following command in the terminal:

echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p'

This should spit out the “domain name” for your “personal” iCloud DNS. The output looks something like this:

12345678.members.btmm.icloud.com

To use this in a ssh command you would need the name of the remote machine plus the information above:

ssh -2 -6 remote-hostname.12345678.members.btmm.icloud.com

That’s it…..you should see a prompt for ssh login to your remote machine.… Read the rest

Synology NAS and those pesky @eaDir folders

datePosted on 20:22, March 8th, 2012 by Many Ayromlou

If you’ve enabled MediaServer and/or PhotoStation on your Synology NAS you might have noticed a bunch of “@eaDir” folders inside your data folders. You will not normally see this under samba or appletalk connections. I noticed it since I was trying to rsync from synology to a old qnap nas I have lying around. Although you can turn these services off from the Control Panel, it does not get rid of these dumb folders. So here is a quick script to clean all the “@eaDir” folders up from your synology disk. NOTE: I’VE INTENTIONALLY NOT USED THE “rm -rf” COMMAND HERE. I DON’T WANT YOU TO DESTROY YOUR NAS SERVER WITH JUST ONE COMMAND. Run the command below and it will “echo” the names of these “@eaDir” folders to the terminal.… Read the rest

Stream your Windows desktop using ffmpeg

datePosted on 10:26, November 3rd, 2011 by Many Ayromlou

I’ve already covered how to do this with vlc a while back in parts 1 followed by part 2. I just found out that something very similar in results can be done with ffmpeg. ffmpeg has recently added support for directshow filters which now allows one to capture the screen and stream and/or save it. Here is how you can do this:

1.) Grab a copy of the Screen Capture DirectShow source filter from Unreal Streaming Technologies. It’s about half way down that page. They have both the UScreenCapture X86 Edition and the X64 Edition (depending on your OS installation). I used the 64 bit filter on a Windows 7 64 bit installation.

2.) Install the filter and make sure you make the following changes to your windows registry using regedit.… Read the rest

123456Next