cd /music/Pearl Jam/Ten
mkdir tmpoceans
# split the file
split -b 400k 07\ -\ Oceans.ogg tmpoceans/07\ Oceans.ogg.
# check the created parts
ls -1 tmpoceans
07 Oceans.ogg.aa
07 Oceans.ogg.ab
07 Oceans.ogg.ac
07 Oceans.ogg.ad
# split it back
cat 07\ Oceans.ogg.* > 07\ Oceans.ogg
# and play
ogg123 07\ Oceans.ogg
http://www.techiecorner.com/107/how-to-split-large-file-into-several-smaller-files-linux/
http://www.johnrockefeller.net/?p=195
piątek, 27 lutego 2009
wtorek, 24 lutego 2009
Thunar - single click instead of the default double
Edit/Preferences/Behaviour/
Single click to activate items
http://xfce.jakilinux.org/viewtopic.php?id=19
Single click to activate items
http://xfce.jakilinux.org/viewtopic.php?id=19
poniedziałek, 23 lutego 2009
Subversion - repository URL of working copy
That tiny script is useful when you've got a few branches and dir names do not reflect those in the repo, eg. branch1, branch2 vs http://oursvnrepo/importantproject/branches/{somefeature,anotherfature} (quite possible in large projects with frequently created branches). Yes, it could be a bit more elegant and discover when the parameter is not a directory, but anyway:
# !/bin/bash
# usage:
# svnpath - SVN repo URL for current dir
# svnpath dirname - svn repo URL for given dir
if [ -z "$1" ]
then
grep '//' .svn/entries | head -n1
else
grep '//' "$1"/.svn/entries | head -n1
fi
# !/bin/bash
# usage:
# svnpath - SVN repo URL for current dir
# svnpath dirname - svn repo URL for given dir
if [ -z "$1" ]
then
grep '//' .svn/entries | head -n1
else
grep '//' "$1"/.svn/entries | head -n1
fi
Other users' Oracle sessions
select process, program, osuser, sid, serial#,
BLOCKING_SESSION_STATUS, SECONDS_IN_WAIT, lockwait, status
from v$session
where type = 'USER'
and nvl(osuser, 'nomycurrentuser') != 'mycurrentuser'
BLOCKING_SESSION_STATUS, SECONDS_IN_WAIT, lockwait, status
from v$session
where type = 'USER'
and nvl(osuser, 'nomycurrentuser') != 'mycurrentuser'
piątek, 20 lutego 2009
Useful SQL+ commands, part 1
Useful for "reports"
set linesize 200
set pages 0 -- effectively switches off any headers
Useful for displaying long columns - not only LONG but e.g. XMLType
set long 10000 -- ... or so
set linesize 200
set pages 0 -- effectively switches off any headers
Useful for displaying long columns - not only LONG but e.g. XMLType
set long 10000 -- ... or so
Import Oracle dump into an existing schema
- First drop all sequences for a user:
declare
cursor cr is select sequence_name from user_sequences;
begin
for c in cr loop
execute immediate 'drop sequence ' || c.sequence_name;
end loop;
end;
/ - Import dump file
impdp appadmin/password directory=dmpdir dumpfile=appadmin.dmp SCHEMAS=appadmin table_exists_action=replace - It uses non-standard directory dmpdir instead of the default one DATA_PUMP_DIR, to create it run sth like:
CREATE OR REPLACE DIRECTORY dmpdir as '/opt/oracle/dmp'
from an account with proper privs (CREATE ANY DIRECTORY, "/ as sysdba" has got it definitely)
Mocp output in Xfce panel
- Get Generic Monitor for the Xfce4 panel
sudo aptitude install xfce4-genmon-plugin # or equivalent - Create a script generating your output, e.g.
echo "mocp -i | egrep 'SongTitle|Artist' | cut -d":" -f2" > ~/bin/mocpinfo4panel - Add Generic monitor to Xfce panel and input the script name into Command field, probably also change label to "mocp" or "now playing" or "what I could listen to if I didn't forgot my earphones" (well, perhaps a bit excessive).
Subskrybuj:
Posty (Atom)