20gnd + tipsandtricks   493

Batch -change month # to letters
First off, you can save yourself all those for statements. Since NT has a built-in DATE var, you can simply use substrings to get the parts you need.
In my case the DATE var is:
Sat 29-04-2006
so doing this:
set YYYYMMDD=%date:~10,4%%date:~7,2%%date:~4,2%
will set a new var called YYYYMMDD
BTW, it's not usually a good idea to alter a built-in var, like DATE.
Moving right along, I guess the simplest way to change 'numeric' month to 'named' month is with a chunk of code like this:
#####
if %MM%==01 set MM=Jan
if %MM%==02 set MM=Feb
if %MM%==03 set MM=Mar
if %MM%==04 set MM=Apr
and so on
#####

My solution:

set __MONTH.01=Jan
set __MONTH.02=Feb
set __MONTH.03=Mar
set __MONTH.04=Apr
set __MONTH.05=May
set __MONTH.06=Jun
set __MONTH.07=Jul
set __MONTH.08=Aug
set __MONTH.09=Sep
set __MONTH.10=Oct
set __MONTH.11=Nov
set __MONTH.12=Dec

REM See also:
REM http://ings.ca/jim/2008/02/10/adding-timestamps-in-a-dos-batch-file/
set cur_yyyy=%date:~10,4%
set cur_mm=%date:~4,2%

for /f "tokens=2* delims=.= " %%a in ('set __MONTH.') do (
if %%a == %cur_mm% set cur_mmm=%%b
)

set monthfolder="%cur_yyyy%-%cur_mm% (%cur_mmm%)"
if not exist %monthfolder% mkdir %monthfolder%
batchfile  batchprogramming  dos  datetime  scripting  tipsandtricks  dammitbrain  sysadmin  batch  programming  reference  solution 
2 days ago by 20gnd
Search for lines not containing pattern - Vim Tips Wiki
/v^(.*Warning)@!.*$
"Which works for a /word/, but which may not work for a phrase...

keywords:match find phrase word
vim  dammitbrain  searchandreplace  find  editing  tipsandtricks  essential  solution 
2 days ago by 20gnd
Langa Letter: How To Save An Hour (Or More) On XP Installs
Prepatch your XP Setup CD once, and never have to install SP2 again. Fred Langa walks you through a 16-step process.
slipstream  installation  windows  winxp  servicepack  sysadmin  tipsandtricks  systemrecovery 
13 days ago by 20gnd
Langa Letter: XP's Little-Known 'Rebuild' Command
There's an easy fix for "Missing HAL.DLL," "Invalid Boot.Ini," and several other fatal startup errors, Fred Langa says.

* Boot from your XP Setup CD and enter the Recovery Console
* Run "Attrib -H -R -S" on the C:Boot.ini file
* Delete the C:Boot.ini file
* Run "Bootcfg /Rebuild"
* Run Fixboot
recoveryconsole  disasterrecovery  windows  systemrecovery  sysadmin  installation  tipsandtricks 
13 days ago by 20gnd
Changes in RRAS require IPSEC Services Restart??? - Virtual Dr Forums-Computer Tech Support
net stop RemoteAccess
net stop PolicyAgent
net start PolicyAgent ------ Very important that IPSEC restarts before RRAS
net start RemoteAccess
vpn  windows  sysadmin  rras  services  tipsandtricks  remoteaccess  networking  pptp  l2tp 
20 days ago by 20gnd
Retrieving dropbox_path from config.dbx « Dropbox Forums
Technical details for anyone interested (hi Eliphas!) - in version 1.2/1.3 of Dropbox there's host.db which as noted above contains the base64 encoding of the dropbox path on the second line http://forums.dropbox.com/topic.php?id=47330 however this is a "read only" copy of the encrypted value stored in config.dbx and changing the value in host.db doesn't move the Dropbox folder. However if you move the dropbox folder using the preferences option https://www.dropbox.com/help/89 the value in host.db does change to match.
There's also an unencrypted config.db but before you get your hopes up ;) all it stores is a single table (config) containing a single key (config_schema_version) with a single value (2).
So...
if: config_schema_version = 0 then: Dropbox Client < 0.8
if: config_schema_version = 1 then: Drobbox Client >= 0.8 and Drobbox Client < 1.2
if: config_schema_version = 2 then: Drobbox Client >= 1.2
dropbox  solution  annoyance  tipsandtricks 
20 days ago by 20gnd
Disable auto-restart after BSOD from RC - TechSpot Forums
Actually, you can disable this from the F8 screen during boot-up of XP and later.
windows  sortofsolution  sysadmin  bsod  tipsandtricks 
5 weeks ago by 20gnd
Help:User style - Wikipedia, the free encyclopedia
/*Display body content in a narrower column for easier reading*/ /*adjust percentages as desired*/ div#bodyContent { width: 50%; line-height: 105%; }
mediawiki  skin  userstyle  tipsandtricks  webmaster 
5 weeks ago by 20gnd
Easy way to determine resolution of bitmaps in PDF file ? - Color Printing Forum
Enfocus PitStop (a plug-in app for Acrobat) has a tool Inspector that gives you stats on not only resolution, but color space, text used, colors, color conversions, and so on. I have found it to be the best all-around PDF editor and for that reason as well as many many others.
It is not cheap, but it will pay for itself 100 times over in six months of use.
prepress  pdf  acrobat  tipsandtricks  design 
6 weeks ago by 20gnd
tools - how to prevent vim from creating (and leaving) temporary files? - Stack Overflow
Some ideas on how to "securely" edit files with vim, i.e., without creating temp files elsewhere on the filesystem.
vim  solution  security  tempfile  tipsandtricks  textedting 
7 weeks ago by 20gnd
SystemRescueCd - View topic - Confused about Backstore
using the boot-usbstick for backstore is no problem.
The path to the backstore file on the usbstick has nothing to do with the path where you mount the stick while creating the bs file.

To create a default loading bs file on the booted stick's root do

#make the stick writable
mount /livemnt/boot -o remount,rw
#create the file
sysresccd-backstore create /livemnt/boot/sysrcd.bs 256
#"sync" it
mount /livemnt/boot -o remount,ro
reboot

Gernot
liveusb  backstore  systemrescuecd  persistentstorage  solution  tipsandtricks 
9 weeks ago by 20gnd
Multitouch/AppleMagicTrackpad - Ubuntu Wiki
Section "InputClass" Identifier "Magic Trackpad" MatchUSBID "05ac:030e" Driver "synaptics" EndSection
synaptics  touchpad  magictrackpad  mac  hardware  ubuntu  tipsandtricks  solution  hci  mouse 
10 weeks ago by 20gnd
[HOWTO] Apple Magic Mouse on 10.10 Maverick Meerkat - Ubuntu Forums
xinput set-float-prop "Apple Magic Mouse" "Device Accel Velocity Scaling" 2.0

Also (to get the pairing to "stick" between reboots), this was required:
/var/lib/bluetooth/00:02:72:1E:DB:BD/pincodes

add the line:

28:37:37:2B:E2:4C 0000
magicmouse  mac  hardware  ubuntu  inputdevice  hci  tipsandtricks  solution 
10 weeks ago by 20gnd
fontfeatures.pdf
New typographic features by improved Graphite port of the last release of Libertine Open Fonts, examples: NEWS.pdf and NEWS.odt, documentation: fontfeatures.pdf and fontfeatures.odt (László Németh, improvements of Libertine Open Fonts: Philipp Poll et al.)
libertine  fonts  libreoffice  typography  tipsandtricks  dtp 
february 2012 by 20gnd
dre's tips & tricks
Topics:

Shells and shell scripting
loops
testing for arguments
dynamically updating terminal window title
zsh command prompts and aliases

General Unix stuff
recursive media whacking with wget
apache host-allow to restrict directories by client host
System stats with phpsysinfo

Mac OS X Specific stuff
SSH key management in Mac OS X
Saving and recalling Terminal.app sessions
Monitoring throughput with ifstat
Running Mac OS X services on alternate ports
Automating the use of background color to distinguish between terminal windows
Script to enable a dock pinning menu
mac  osx  scripting  tipsandtricks  list  unix  finder 
february 2012 by 20gnd
« earlier      

related tags

10.5.8  11.04  11.10  @font-face  accountdelegation  acf  acrobat  actions  addressbook  advice  advocacy  airprint  alternatekeymaps  altkeymaps  annoyance  annoyances  antivirus  apache  apple  applescript  apt  apt-cacher  apt-get  apt-xapian-index  archive  article  audiophile  audiovideo  auditing  autocompletion  autohotkey  automator  autostart  backstore  backup  backupandrecovery  backupfiles  bartpe  bash  batch  batchfile  batchprogramming  battery  bestpractice  bestpractices  bitlocker  blog  blogs  bookmarkbar  bookmarklet  bookmarks  bootablecd  bsod  bugs  by:20gnd  caldav  calendar  camino  carpaltunnel  casper  cdburning  cdrecord  cellular  changepassword  cheatsheet  chrome  classic  classicgaming  cleaning  cleanup  clipboard  cloudstorage  cmd.exe  code  codecs  codeeditor  coding  collaboration  colorscheme  columns  comdlg32  commandline  commondialogs  communication  comparison  compass  compiler  compiz  compression  computing  configfile  confused  console  contacts  contextmenu  contrastmask  converter  cover.jpg  cpanel  cron  crossbrowser  crossplatform  csh  css  cssbugs  csv  ctags  cups  customization  cygwin  dammitbrain  database  datetime  dba  dd  debian  debugging  design  desktop  desktopcustomization  desktopenvironment  devel  dictd  dictionaries  disasterrecovery  diskutil  dock  dockbarx  domain  domaintransfer  dos  doubleplusgood  downloadmanager  drivers  dropbox  dropdownconsole  dtp  dualboot  duplicateemails  duplicity  dvd  editing  editor  editors  eeepc  elementary  email  emailaliases  encryption  environmentvariables  epiphany  essential  essentialhowto  evdo  evernote  example  examples  exercises  explorer  ext2  ext3  ext4  extension  eyecandy  f-prot  facebook  faenza  faq  favicon  feed  feedburner  filecomparison  filemanagement  filemanagment  filesharingprotocols  filesynchronization  filesystems  filtering  find  finder  firefox  flags  flashblocker  flashplugin  flattreeview  floats  foldericon  fonts  formatconversion  formatoptions  forms  freesoftwarealternatives  freestuff  freeware  from:twitter  fspot  fuckina  fuser  Geek  genuineadvantage  ghostscript  gimp  git  git-rm  githacks  gmail  gnome  gnomepanel  gnuparallel  google  googleapps  gpo  greenscreen  growisofs  grub  gtd  guide  guru  hacking  hacks  harddiskdrives  hardlink  hardware  hawaii  hax0rtips  hci  health  helpfpul  historyexpansion  homebrew  homebrewing  homeopathy  homeremedy  hosting  hotfix  hotkey  hotkeys  household  howto  html  html5  htmlentities  htmlmailsucks  htmlnavbars  http  huhididntknowthat  icons  imageediting  imagemagick  imagemagickformatstrings  imageprocessing  imagereplacement  imap  importexport  inboxzero  incrementalbackup  inertialscrolling  initscript  inkscape  inputdevice  installation  interesting  internetexplorersucks  ios  iphone  ipod  irc  itms  itunes  ivfluids  keepass  keyboard  l2tp  laptop  launchy  layout  lbr  ldap  leopard  libertine  libreoffice  life2.0  linux  LinuxHelp  linuxmint  list  lists  livecd  liveusb  localfilelink  logfiles  logokey  lsof  mac  macosx  MacOSXTech  magic  magicmouse  magictrackpad  mail  mailfiltering  mailman  mailmerge  mailuseragents  make  makefiles  maps  marketing  marlin  maybesolution  mdadm  mediawiki  messaging  migration  mkisofs  mobile  mod_autoindex  mouse  mozilla  msi  msword  multipleinstances  multipleinstancesofdropbox  multiuser  mutt  mysql  n00b  nas  natty  natural  nautilus  netbook  netbook-launcher  netinstall  netsend  networkfilesharing  networking  newbie  news  newsletter  nginx  nmap  nonprintablechars  notationalvelocity  notebook  notepad2  notetaking  ntcmdisnotarealprogramminglanguage  nursing  objectivec  office  offline  oneiric  onlinefilestorage  onlinestorage  openoffice  openssh  openssl  openvpn  optimization  osx  packagemanagement  pagefile  par  par2  parallel  parallelprocessing  paranoia  parity  passphrase  password  passwordless  passwordmanager  passwordrecovery  patch  pdf  pdfhyperlinks  peppermint  percentescapes  performance  persistence  persistentfilestore  persistentstorage  photoediting  photography  php  pipe  placesbar  plaintext  planescapetorment  plugin  plugins  postinstalltweaks  postscript  postthumbnails  powerbook  powermanagement  pptp  preference  prefs.js  prepress  printing  prism  privacy  procmail  productivity  profile  programming  proxy  putty  python  qanda  qos  QuickRef  quickreference  quicksilver  raid  rdiff-backup  rdp  realife  recovery  recoveryconsole  redirect  redmon  reference  refresh  regularexpressions  reinstall  rememberthemilk  remoteaccess  remoteadministration  remotedesktop  repair  repository  resizabletextarea  responsive  restoration  retrocomputing  ribbon  roundedcorners  rras  rsi  rsnapshot  rss  rsync  rtm  ruby  safari  safesleep  samba  samplecode  sass  screen  screencapture  screensharing  screenshot  script  scripting  scripts  scrollwheel  searchandindex  searchandreplace  searchpatterns  secureerase  security  sed  sendto  servicepack  services  sharedaddressbook  shell  shellenhancement  shellscripting  shortcutkey  shortcutkeys  shortcuts  simplenote  sites  skin  slidingdoors  slipstream  smart  snipmate  snippets  snippits  snowleopard  socialmedia  socks  software  softwareraid  solution  sortofsolution  spam  spamassassin  spamsucks  spanningmultipledvdbackups  specialcharacters  sprint  sqlite  squeezebox  ssh  stdin  sublimeeditor  symlinks  synaptics  sync  syncback  synchronization  sysadmin  systemmonitoring  systemnotification  systemrecovery  systemrescuecd  t-mobile  table  tables  taskbar  taskscheduler  tempfile  tempfiles  textediting  texteditor  textedting  textexpansion  textprocessing  textwrapping  theloop  thewaythingswere  thunderbird  tinurl  tipsandtricks  todo  tomato  touchpad  tray  tricks  truecrypt  tunneling  tunnels  tutorial  tweaking  twitter  typography  ubuntu  ubuntuessentials  ubuntuone  ubuntuoverlayscrollbars  undobutton  une  unicode  unison  unity  unix  unlimiteddata  unr  update  updates  urlrewriting  userChrome.css  userhelp  userprofiles  userscripts  userstyle  utility  variable  vboxphysicalpartition  vbscript  vcard  versioncontrol  vet  vettech  vhd  via:ifttt  video  vim  vimcommandline  vimdiff  vimrc  vimvariables  vinyl  virtualbox  virtualdisk  virtualization  VirtualizationAndEmulation  vista  vmware  vnc  volumelimiter  von  vpn  wallpaper  WatchList  web  webapp  webapps  webbrowser  webbrowsers  webdesign  webdev  webdevel  weblite  webmaster  wga  wicd  wifi  wiki  win7  windowdragon  windowmaker  windowmanager  windowmanagers  windows  windows7  windowsnt  windowsonly  windowssucks  windowsxp  wine  winmerge  winxp  wireless  wmctrl  wordpress  wordwrap  work  wp-config  x11  x86_64  xauth  xcompmgr  xdg  xml  xmodmap  youtube  zindus 

Copy this bookmark:



description:


tags: