Arguments
use masterEXEC sp_configure ‘show advanced options’, 1RECONFIGUREEXEC sp_configure ‘xp_cmdshell’, 1RECONFIGURE
Arguments
use masterEXEC sp_configure ‘show advanced options’, 1RECONFIGUREEXEC sp_configure ‘xp_cmdshell’, 1RECONFIGURE
With one magic command in terminal with super-user assigned. Step to do:
1. sudo -i
2. Enter your password
3. Create the folder in new location
4. The magic command:
ln -s /Volumes/<New location> /Users/<Your user folder>/Library/Mail
/System/Library/CoreServices/Dock.app/Contents/MacOS
Dành cho con giời nào thích phá. Mở terminal, gõ sudo nano /etc/sysctl.conf enter, điền password xong paste cái này vào:
kern.sysv.shmmax=536870912
kern.sysv.shmall=131072
kern.sysv.shmmin=1
kern.maxproc=2048
kern.maxprocperuid=1024
kern.ipc.somaxconn=8192
kern.ipc.maxsockbuf=4194304
kern.ipc.somaxconn=32768
net.inet.tcp.rfc1323=1
net.inet.tcp.win_scale_factor=3
net.inet.tcp.sockthreshold=16
net.inet.tcp.sendspace=250000
net.inet.tcp.recvspace=250000
net.inet.tcp.mssdflt=1440
net.inet.tcp.msl=10000
net.inet.tcp.always_keepalive=1
net.inet.tcp.keepidle=120000
net.inet.tcp.keepinit=1500
net.inet.tcp.keepintvl=1500
net.inet.tcp.delayed_ack=0
net.inet.tcp.slowstart_flightsize: 4
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.icmp.icmplim=50
net.local.stream.sendspace=163840
net.local.stream.recvspace=163840
net.local.dgram.recvspace=4096
net.inet.tcp.slowstart_flightsize=89
net.inet.tcp.local_slowstart_flightsize=10
net.inet.tcp.mssdflt=1460
net.inet.tcp.delayed_ack=3
net.inet.tcp.delayed_ack=0
net.inet.tcp.delayed_ack=3
xong bấm Ctrl+X, bấm Y, Enter, gõ reboot, enter và cảm nhận nhé.
1.0 + floor(14 * RAND(convert(varbinary, newid())))
use master
declare @PageSize varchar(10)
select @PageSize=v.low/1024.0
from master..spt_values v
where v.number=1 and v.type=’E’
select name as DatabaseName, convert(float,null) as Size
into #tem
From sysdatabases where dbid>4
declare @SQL varchar (8000)
set @SQL=”
while exists (select * from #tem where size is null)
begin
select @SQL=’update #tem set size=(select round(sum(size)*’+@PageSize+’/1024,0) From ‘+quotename(databasename)+’.dbo.sysfiles) where databasename=”’+databasename+””
from #tem
where size is null
exec (@SQL)
end
select * from #tem order by DatabaseName
drop table #tem
C:\Users\Pinal>sqlcmd -S LocalHost -d master -A
1> DROP TRIGGER Tr_ServerLogon ON ALL SERVER
2> GO
The default shell for Leopard users is Bash. Although many GNU/Linux users are familiar with it, not all Mac users take full advantage of its power. Here are some very useful terminal commands and tips for hidden Mac OS X settings.
You’ll find the Terminal in the Utilities folder within the Applications folder. To carry out any of the following commands you will need to copy/paste or type in the line of text then hit enter. For the most part, applications will need restarting before changes take place.
defaults write com.apple.finder FXListViewStripes -bool FALSEdefaults write com.apple.finder QuitMenuItem -bool YES
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain userdefaults write com.apple.finder _FXShowPosixPathInTitle -bool YESdefaults write -g NSNavPanelExpandedStateForSaveMode -bool TRUE
defaults write com.apple.finder AppleShowAllFiles TRUE
defaults write com.apple.dock no-glass -boolean YES

defaults write com.apple.dock tilesize -int 256defaults write com.apple.dock largesize -int 512defaults write com.apple.dock enable-spring-load-actions-on-all-items -boolean YESkillall Dockdefaults write com.apple.dock workspaces-edge-delay -float 0.5defaults write com.apple.dock workspaces-wrap-arrows -boolean NO

defaults write com.apple.finder DesktopViewOptions -dict IconSize -integer 512 killall Finde
defaults write com.apple.screencapture type jpg
This command enables widgets to be placed onto the desktop. Drag a widget around and press F12 to drag it onto the desktop. Repeat the process again to drag a widget back onto the dashboard.defaults write com.apple.dashboard devmode YESdefaults -currentHost write com.apple.screensaver askForPassword -int 0
sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 7200defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1sudo chmod 0 /System/Library/CoreServices/Spotlight.app
killall Spotlightmkisofs -allow-multidot -allow-leading-dots -d -hide-rr-moved \ -l -joliet-long -R -T -v \ -V VOLUME_NAME -o output.iso root-cd-dir/ hdiutil burn -noverifyburn output.iso
diskutil unmountDisk /dev/disk2s0 dd if=/dev/disk2s0 of=cdname.iso bs=32m
hdid diskimage.dmg (or .iso)drutil ejectsudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agentipconfig getpacket en0ipconfig getifaddr en1ifconfig eth0 down hw ether (newmacaddresshere) && ifconfig eth0 up && ifconfig eth0 (newipaddresshere) netmask 255.255.255.0 up && /bin/hostname (newhostnamehere)ifconfig en0 ether 00:00:00:00:00:00ifconfig en0 | grep ether | sed s/://g | sed s/ether//lsof -i -n -Plsof -i | grep -E "(LISTEN|ESTABLISHED)" | awk '{print $1, $8, $9}'scutil --dnsecho 'alias wget="curl -O"' >> ~/.bash_profilesudo rebootdefaults write com.apple.CrashReporter DialogType nonesudo sysctl -w kern.exec.archhandler.powerpc=/usr/libexec/oah/RosettaNonGratasudo sysctl -w kern.exec.archhandler.powerpc=/usr/libexec/oah/translateopen /Applications/iTunes.app/ls -lh /dir/or/filesudo killall -9 appnamecd /var cd /etc cd - # will take you to /var
just type "cd ~" or even better "cd"touch /some/thinghead -n 20 /some/thingtail -n 20 /some/thingcat /some/thingdu -kh | sort -nr | morefind . -type f -size +100000k |xargs -I% du -sh %
du -xak ~/ 2> /dev/null | sort -nr | head -n 40We all know that we should back up all the time, especially if we’re going to go tinkering with OS X’s insides.
Seeing someone had accidentally messed up their dock resources folder (found in /System/Library/Core Services/Dock.app/Contents/Resources) I posted in themacrumors forums with a download link for the folder in question.
A year or so later I removed the file from my hosting, only to be bombarded with emails and PMs from others who’d done exactly the same thing – who’d have thought it!
Below you can find a link to the dock resources folder for Snow Leopard.
I’ve been asked for Leopard and other OS X versions of the folder. If you have these then do email them to me so I can add them here!
Snow Leopard 10.6.1: 10.6.1 Resources.zip
Snow Leopard 10.6.3: 10.6.3 Resources.zip
And for the future?
So if you need to delete some files larger than X mb on your Mac or some unix server, here is the simple oneliner to do it, in this example we’re looking for files larger than 10mb in current folder (and subfolders, because find command is recursive) and delete them:
Tìm file lớn hơn 10Mb và xoá
find ./ -size +10000000c -exec rm {} \;
And to be sure that you’ll be deleting the right files, you can first list them like this:
find ./ -size +10000000c -exec ls -la {} \;