Posts

awk multiple delimiters

Good news! awk field separator can be a regular expression. You just need to use -F"<separator1>|<separator2>|..." : awk - F "/|=" '{print $3, $5, $NF}' file Returns: tc0001 tomcat7 . 1 demo . example . com tc0001 tomcat7 . 2 quest . example . com tc0001 tomcat7 . 5 www . example . com Here: -F="/|=" sets the input field separator to either / or = . Then, it sets the output field separator to a tab. {print $3, $5, $NF} prints the 3rd, 5th and last fields based on the input field separator. See another example: $ cat file hello#how_are_you i#am_very#well_thank#you This file has two fields separators, # and _ . If we want to print the second field regardless of the separator being one or the other, let's...

TAVUKLU PİRİNÇ ÇORBASI

Image
Malzemeler – 2 parça tavuk göğsü – 1 çay bardağı pirinç – 5 su bardağı tavuk suyu – 2 yemek kaşığı zeytinyağı – 1 küçük patates – Tuz Yapılışı: Tavuk göğsünü yıkayın ve haşlayın. Daha sonra tavuk göğsünü küçük parçalar haline getirin. Bu sırada patatesi ve pirinci yıkayın. Malzemenin geri kalanını başka bir tencereye koyun ve tavuk suyundan üzerine ekleyerek kaynamaya bırakın. 10 dakika sonra tavukları da içine ekleyin ve pişene kadar hafif hafif karıştırmayı ihmal etmeyin.

SEBZELİ TAVUK SOTE

Malzemeler – Yarım tavuk göğsü – Yarım kapya biber – Bir küçük boy domates – Ufak boy soğanın yarısı – Kimyon ve karabiber Yapılışı: Soğanı küp küp doğrayın ve biberi rendeleyin. Geniş bir tencereye zeytinyağı dökün ve önce soğanları sonra da biberleri tencereye ekleyip kavurun. Malzemeler yumuşadığında tencereye tavuğu ekleyin, birkaç dakika sonra domatesi küp küp keserek tencereye atın ve karıştırmaya devam edin. Soteleme tamamlandığında tencereye su ekleyin ve pişirmeye bırakın. Baharatları da ekledikten sonra tavuğun piştiğinden emin olun ve soğumaya bırakın.

Splitting ape or flac

Splitting To split an audio file accompanied by a CUE sheet into tracks in   .wav   format, use the   shnsplit   command: $ shnsplit -f file.cue file.ape To split   .bin   file with CUE sheet into tracks in   .wav   format: $ bchunk -v -w file.bin file.cue out Format for output file names can be specified with the   -t   option ( %n   for track number,   %t   for title): $ shnsplit -f file.cue -t "%n %t" file.ape shnsplit   supports on-the-fly encoding to many lossless formats (see   shntool(1)   for the full list). For example to encode split tracks in the FLAC format: $ shnsplit -f file.cue -o flac file.ape Encoding options, including the encoder itself, can be specified with the   -o   parameter (see   shntool(1)   for details): $ shnsplit -f file.cue -o "flac flac -s -8 -o %f -" file.ape The formats supported by   shntool   and default encoder options...

Removing tags in html (and similar) files

sed - e 's/<[^>]*>//g' file . html

Excel: Vba code for deleting entire row based on a criteria

Sub Loop_Example() Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long Dim ViewMode As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With 'We use the ActiveSheet but you can replace this with 'Sheets("MySheet")if you want With ActiveSheet 'We select the sheet so we can change the window view .Select 'If you are in Page Break Preview Or Page Layout view go 'back to normal view, we do this for speed ViewMode = ActiveWindow.View ActiveWindow.View = xlNormalView 'Turn off Page Breaks, we do this for speed .DisplayPageBreaks = False 'Set the first and last row to loop through Firstrow = 6 Lastrow = 6359 'We loop from Lastrow to Firstrow (bottom to top) For Lrow = Lastrow To Firstrow Step -1 'We check the values in the A column in this example With .Cells(Lrow, "EC") If Not IsError(.Value) Then If .Value = 0 ...

Excel: Count number of spaces in a cell

=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))

Sıcak Şarap Tarifi

Malzemeler: 1 litre sofra şarabı 2 adet portakal 1 adet elmanın kabuğu ve soyduğunuz elmanın yarısı 3 adet çubuk tarçın 15 diş karanfil 2 adet kuru incir 2 adet kuru kayısı yarım su bardağı toz şeker (damak tadına göre artabilir ya da azalabilir) isteğe göre 2-3 adet çilek ve 1 adet kırmızı pancar eklenebilir. Yapılışı: Adet portakalın kabuğunu soyun, portakal kabuğuna karanfil dişlerini saplayın. Kabuğunu soyduğunuz portakalı ve diğer portakalın suyunu sıkın. Elmanın kabuğunu soyarak çekirdeklerini çıkartın ve küp küp doğrayın. Kayısıları ve kuru incirleri 2 parçaya bölün. Portakal suyunu ve şarabı tencereye alın, şekeri ekleyerek kısık ateşte ısıtmaya başlayın. Hazırladığınız malzemeleri tencereye ekleyin, kısık ateşte 15 kaynama noktasına gelene kadar ısıtın ve sıcak servis yapın

Triangular protractor with TikZ

Image
Following latex code will create a triangular protractor below: \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc, intersections} \tikzset{ numbers/.style={fill=white,font=\scriptsize}, degrees/.style={below, anchor=north, text centered, inner ysep=2pt, text width=5mm, rotate=\mnum-270, fill=white, font=\scriptsize} } \begin{document} \begin{tikzpicture}%[transform shape, rotate=90] % uncomment for rotating picture % finding right angle \path[name path=line 1] (-8,0) --++ (-45:11.5); \path[name path=line 2] (8,0) --++ (225:11.5); % draw border \draw[line width=.3pt, name path=border, name intersections={of=line 1 and line 2,by=A}] (A) -- (8,0) coordinate (B) -- (-8,0) coordinate (C) -- cycle; % top ruler \foreach \tnum in {-7,-6,...,7}{ \pgfmathtruncatemacro\tnuma{abs(\tnum)} \draw (\tnum,0) -- (\tnum,-.2) node[numbers, below] (n\tnum) {\tnuma}; \ifnum\tnum \draw (\tnum+.5,0) -- (\tnum+.5,-.2); \else\fi ...

Latex protractor (360 degrees)

Latex code for protractor (180 degree)

\documentclass [ pstricks,border = 12pt ]{ standalone } \SpecialCoor \usepackage { pst-node,multido } \makeatletter \def\@protractor #1 { % \psset { dimen = middle,linewidth = .5 \pslinewidth } \pscustom { \psarc ( 0,0 ){ #1 }{ 0 }{ 180 } \psline ( -#1,-.3 )( #1,-.3 ) \closepath } \multido { \na = 0+90 }{ 3 }{ \psline ( !#1 .725 mul \na\space PtoC )} \multido { \ns = 0+1 }{ 180 }{ \psline ( !#1 .975 mul \ns\space PtoC )( #1; \ns )} \multido { \nm = 0+5 }{ 37 }{ \psline ( !#1 .950 mul \nm\space PtoC )( #1; \nm )} \multido { \nl = 0+10 }{ 19 }{ % \psline ( !#1 .925 mul \nl\space PtoC )( #1; \nl ) \uput { !#1 .850 mul }[ \nl ]{ ! \nl\space 90 sub }( 0,0 ){ \small $ \nl $ } \uput { !#1 .775 mul }[ !180 \nl\space sub ]{ !90 \nl\space sub }( 0,0 ){ \small $ \nl $ } \psline ( !#1 .05 mul \nl\space PtoC )( !#1 .725 mul \nl\space PtoC ) }} \def\protractor { \pst@object { protractor }} \def\p...

To make dotted line in Adobe Illustrator

Go to the stroke tab. Just enter the following values after enabling the dashed line : 0 for the dash double the stroke for the gap

Bir Word Belgesinde Kapak Harici Kaç sayfa Olduğunu Bulmak

To count the number of pages in a MS Word document without the front page you do the following Press Ctrl+F9 . Word inserts an empty set of field code braces Type an equal sign and a space Press Ctrl+F9 again. Word inserts another empty set of field code braces Type NUMPAGES and a space. Position the insertion point just between the final two right braces. Type a minus sign and a 1. Your field code for the Y page number should now look very similar to this:  { = { NUMPAGES } – 1 } Press Shift+F9 to collapse the fields. The "1" may be exchanged for any other number if you want. SECTIONPAGES may be used to get the number of pages in a section of a document.

Batch creating files from a list in file

for /f %a in (list.txt) do echo. > %a.mkv

Mac Mini Windows (Bootcamp) screen is smaller than monitor size

When the windows screen size is smaller than the available monitor size, do the following Go to the following key in the registry:     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\video{####....}\0000 Create a new DWORD with the name : "DigitalHDTVDefaultUnderscan" and value 0x0000

Excel find a text in a cell

=IF(ISNUMBER(SEARCH("*dog*",A1)),"dog","")

How to create ISO image in a Mac

Image
Consider you have a CD/DVD at hand and want to create an image (.iso) of the disc so that you can share backup/archive your library. Having inserted the CD/DVD in the drive (assuming you have one), run Disk Utility. After selecting the disk (see image below which was stolen from here ), go to File > New > Disk Image from ".....".From the pop-up window, make sure that DVD/CD Master is selected as the Image Format — that ensures the contents of the disk are completely copied into a resultant .cdr image (Tip: keep the image’s name short and simple so that it can be easily reproduced). After the .cdr image is created, run Terminal and go to the folder where you created the .cdr image. Type the following command hdiutil makehybrid -iso -joliet -o [filename].iso [filename].cdr

Künefe Tarifi

Image
Turkish Kunefe (Künefe) Künefe is considered to be one of the most delicious Turkish desserts, especially in the city of Antakya (Antioch) located on Mediterrenean Sea, in Southern Turkey. Although künefe shops are very common throughout Hatay, Kilis, Adana, Mersin and Gaziantep provinces, the city of Antakya in Hatay is known for the best künefe in Turkey. What distinguishes Antakya’s künefe from others is the daily made fresh, elastic cheese that is only made in Hatay region. The kadayıf (shredded phyllo dough) is also made from scratch at small künefe shops in almost every corner in Antakya which I find very entertaining to watch. The künefe shops in Antakya serve the künefe topped with cream or ice cream. Every time I visit home, I go to Antakya which is about two hours from my hometown and have künefe with ice cream. One of my favorite p...