Binary Revolution Forums: Shell tricks - Binary Revolution Forums

Jump to content

Welcome to Binary Revolution Forums

Welcome to the Binary Revolution Forums! You are a guest and are welcome to browse our 7 public forums at the top of the list without registering. All other forums are restricted to registered users only and will give you an "unauthorized" message if you try to browse them. However, if you Register or Sign In (ABSOLUTELY FREE and PRIVATE) you will be able to access many more sections of the site that are reserved for registered members and have lots of other benefits such as bypassing those annoying ads.

  • NO ADS! All of the ads are for GUESTS ONLY!
  • The annoying guest message (this very one) at the top of every page will go away.
  • Access our private messaging system to communicate with other users.
  • Start new topics and reply to others instead of just reading.
  • Subscribe to topics and forums to get automatic updates on watched threads.
  • Add/view events to our community calendar.
  • Customize your profile and see your statistics.
  • Change your preferences such as choosing layouts and tweaking your settings.
  • Contribute your site to our database of links.
  • Access our Gallery and all of its features (instead of just viewing thumbnails) including uploading images of your own.
  • Build up your reputation using our reputation controls.
  • Once again: NO ADS! All of the ads are for GUESTS ONLY! It is all free so Register Now!
Guest Message © 2012 DevFuse
ANNOUNCEMENTS & NEWS:


ANNOUNCEMENT: BinRev is now proud to be hosted and affiliated with lunarpages! See the announcement at the top of the forums for more details.
ANNOUNCEMENT: Follow us on twitter: @binrev @stankdawg

NOTE 2011-11-11: post-dated! I will be getting married on 11/11/11 and will be unavailable for the rest of of November! Any forum issues should be directed to lattera. We apologize in advance for slow responses.

-- StankDawg

  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

Shell tricks Rate Topic: ***** 3 Votes

#81 User is offline   R3DPiLL 

  • Will I break 10 posts?
  • Icon
  • View blog
  • Group: Members
  • Posts: 2
  • Joined: 05-December 10
  • Gender:Male
Reputation: 0
Neutral

Posted 06 December 2010 - 02:02 PM

View PostOctal, on 30 January 2007 - 04:03 PM, said:

whereis firefox



Really nice one! I still consider myself a noob, and I'm not yet entirely confident with the folder structure. I anticipate that this command will help me a lot. A web search tells me that the command
which
does roughly the same thing.
0

#82 User is offline   bitweiler 

  • the 0ne
  • Icon
  • View blog
  • Group: Members
  • Posts: 1
  • Joined: 16-January 11
  • Country:
  • Gender:Male
  • Location:Saint Louis, Missouri
Reputation: 0
Neutral

Posted 19 January 2011 - 10:10 PM

Okay I don't know if this was posted already but to me it's really handy sometimes.
rm'ing files of a certain size in a directory of my choosing all in one go.

find ~/build/ -type f -size 0 -exec rm {} \+

0

#83 User is offline   D9u 

  • the 0ne
  • Icon
  • View blog
  • Group: Members
  • Posts: 1
  • Joined: 24-June 11
  • Country:
  • Gender:Male
  • Location:Earth
Reputation: 0
Neutral

Posted 29 June 2011 - 02:49 AM

Record a desktop session, with audio.

#!/bin/bash
cd $HOME/recordings
SavePath=$(zenity --file-selection --save --confirm-overwrite)
echo "Saving video to $SavePath"

INFO=$(xwininfo -frame)

WIN_GEO=$(echo "$INFO"|grep -e "Height:" -e "Width:"|cut -d\: -f2|tr "\n" " "|awk '{print $1 "x" $2}')
WIN_POS=$(echo "$INFO"|grep "upper-left"|head -n 2|cut -d\: -f2|tr "\n" " "|awk '{print $1 "," $2}')

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $WIN_GEO -r 15 -i :0.0+$WIN_POS -r 15 -acodec pcm_s16le -sameq "$SavePath.avi"

echo "$WIN_GEO -i :0.0+$WIN_POS -acodec"
echo "$WIN_POS"


The script expects a directory named "recordings" under ~/
0

#84 User is offline   dinscurge 

  • Dangerous free thinker
  • Icon
  • View blog
  • View gallery
  • Group: Members
  • Posts: 892
  • Joined: 28-August 08
  • Country:
  • Gender:Male
  • Location:the bunker
Reputation: 16
Neutral

Posted 23 November 2011 - 11:54 PM

dd if=/dev/zero of=location+filename size=blocksize count=number of blocks desired

simple yes but has some uses :p. like if you want to install linux in one partition without setting up logical partitions if say a oem installation on a laptop can wipe out recovery partition which is usually big enough for linux, use the above and
mkswap -filelocation/name-
or you can make your own vaults/encrypted volumes by formating the file like
mkfs.ext4 -filename/location-
mount -o -t ext4 -file location/name- -mount dir-
can use gpg or whatever you prefer to encrypt said file, can do multiple times over if you want. could use the same ddfile/image for anything that needs a partition or where a partition could add security like having all your web content for a web server in said partition and only give the webserver privileges to that image. it will also indicate the speed of your hdd/sdd/ram wherever your writing the file as if=/dev/zero has dd actually write all the bytes to 0
0

Share this topic:


  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic


  • Time Now: Feb 10 2012 08:24 PM