Advertisement
cros

Comandos Linux

Aug 17th, 2017
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. informação sobre o SO instalado
  3. cat /etc/lsb-release
  4.  
  5. sudo blkid -s UUID
  6.  
  7. Montar Sd Card
  8. # modprobe mmc_block
  9. # modprobe wbsd
  10. sudo modprobe tifm_sd
  11. lsblk
  12. sudo lsblk -o MODEL,NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE
  13. sudo modprobe ohci_hcd
  14. =========================================================================================================
  15. Ativar e sesativar Touchpad
  16.  
  17. synclient TouchpadOff=1
  18. synclient TouchpadOff=0
  19. =========================================================================================================
  20. sudo fdisk -l
  21. sudo mount /dev/sda1 /mnt
  22. sudo grub-install --root-directory=/mnt /dev/sda
  23.  
  24. ------------------------------------
  25. sudo aptitude update
  26. sudo aptitude install xxxxx
  27.  
  28. sudo dpkg -i --force-overwrite /var/cache/apt/archives/libjack0_0.118+svn3796-1ubuntu2_i386.deb
  29.  
  30. sudo grub-install --recheck /dev/sdc
  31.  
  32. sudo apt-get remove grub
  33. sudo apt-get install grub /dev/sda
  34. sudo update-grub
  35.  
  36. sudo add-apt-repository ppa:danielrichter2007/grub-customizer
  37. sudo apt-get update
  38. sudo apt-get install grub-customizer
  39. =========================================================================================================
  40.  
  41. clone bootable USB stick
  42.  
  43. Plug in both USB pen drives and type: fdisk -l as root in terminal to see what their device names are.
  44. If they appear as /dev/sdb and /dev/sdc, type in a terminal: dd if=/dev/sdb of=/dev/sdc conv=notrunc.
  45. To make an image of the entire drive including MBR (boot files),
  46. type in terminal:
  47. dd if=/dev/sdb of=/path/to/destination/image.dd conv=notrunc.
  48. To restore the image to a new drive which is seen as /dev/sdb:
  49. dd if=/path/to/image.dd of=/dev/sdb conv=notrunc
  50. dd if=/dev/<device1> of=/dev/<device2>
  51. dd if=/dev/random of=/dev/null bs=1K count=100
  52.  
  53. (pv -n /dev/sda | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0
  54. sudo apt-get install pv dialog
  55. dd if=/dev/urandom | pv | dd of=/dev/null
  56. ==========================================================================================================
  57. Resize fotos
  58.  
  59. mogrify -resize 800x600 -format jpg *
  60. ==========================================================================================================
  61. Restart KDE without rebooting the computer
  62.  
  63.     Save and close all open applications.
  64.  
  65.     Use the Ctrl-Alt-Backspace shortcut keys to restart KDE.
  66.  
  67.     If Ctrl-Alt-Backspace is disabled, type
  68.  
  69.         sudo /etc/init.d/kdm restart
  70. ==========================================================================================================
  71. mplayer -vo fbdev -fs Japmagic.mpg
  72. mplayer -vo svga -ao sdl Japmagic.mpg
  73.  
  74. ==========================================================================================================
  75. #sudo mke2fs -t ext3 -L multiboot /dev/sdb1
  76. #sudo mkdir /media/pendrive
  77. #sudo mount /dev/sdb1 /media/pendrive
  78. #sudo grub-install --force --no-floppy --root-directory=/media/pendrive /dev/sdb
  79. #sudo grub-mkconfig -o /media/pendrive/boot/grub/grub.cfg
  80.  
  81. ==========================================================================================================
  82. normalize -m -V musica.mp3
  83. ==========================================================================================================
  84. Listagem de tudo
  85. ls -R | grep "." > texto.txt
  86.  
  87. ==========================================================================================================
  88. Retirar vocal
  89. install mplayer lame shntool
  90. mplayer -ao pcm:file=<output file> -af karaoke <input file (song)>
  91. lame -V2 <input wav file> <output mp3 file>
  92.  
  93. Special Effects
  94. There is good support for audio effects, and the karaoke effect especially gets interesting with certain songs. It is not perfect, but you can attenuate the voice in a song a great deal. Use the following command to activate karaoke mode:
  95.  
  96. $ mplayer -af karaoke song.mp3
  97. MPlayer also has a ten-octave band equalizer. The following command ignores the middle frequency bands and amplifies the frequencies around 31.25Hz by 7dB, 62.5Hz by 8dB, 125Hz by 5dB and all of the frequencies around 4, 8 and 16Hz are attenuated by 2dB:
  98.  
  99. $ mplayer -af equalizer=7:8:5:0:0:0:-2:-2:-2 video.mpg
  100. The following command gives a live effect to playback. Try it with songs that sound monotonous:
  101.  
  102. $ mplayer -af extrastereo song.mp3
  103. You can issue a command like the following to play the third song five times:
  104.  
  105. $ mplayer song1.mp3 song2.ogg file.wav -loop 5
  106. If you want to repeat the whole list five times, type the following instead:
  107.  
  108. $ mplayer { song1.mp3 song2.ogg file.wav } -loop 5
  109. You also can use -loop 0 to play something over and over again.
  110.  
  111. Additionally, there are many audio effect plugins designed especially for multichannel and 3-D audio. If you want some really advanced audio effects, try the SoX Swiss Army knife. It is another command-line application that excels in professional audio effects.
  112.  
  113. You can specify multiple audio filters on the command line and they are applied one after another in a chain.
  114.  
  115. What if you like a certain audio filter chain and you want to save the resulting audio to a file? The following command saves the output of filtering to the file named filtered.wav rather than playing it:
  116.  
  117. $ mplayer -ao pcm:file=filtered.wav -channels 4 -af
  118. lavcresample=48000,hrtf,pan=2:1:0:0:0.3:0.5:0.5:0:12 audio.ogg
  119. The lavcresample filter resamples the frequency of audio.ogg to 48,000Hz.
  120.  
  121. The pan filter is a very powerful and sophisticated filter. It mixes the input audio channels into the specified output channels in various amplitudes.
  122.  
  123. In this example, we use the -channels switch to specify four input channels. The first argument to pan is 2 to specify two output channels. In the first pair of arguments after that, the 1:0 specifies the amplitude of the first input channel that is fed into the two output channels. It goes into the left channel with an amplification factor of 1. The second input channel goes into the right channel with an amplification factor of 0.3 (0:0.3), and the third input channel is divided equally into both output channels (0.5:0.5). The fourth channel goes into the right channel with an amplification factor of 12.
  124.  
  125. You can use the following command to re-encode the WAV file to Ogg:
  126. Get ffmpeg, dvdauthor, dvdstyler installed on your system, then you can:
  127.  
  128. Code:
  129. ffmpeg -i source.avi -target ntsc-dvd target.mpg
  130. and either do this to make a simple DVD:
  131.  
  132. Code:
  133. dvdauthor -t -o target.dvd -f target.mpg
  134. dvdauthor -T -o target.dvd
  135. or use dvdstyler to create a basic menu structure.
  136.  
  137. man ffmpeg for more options on creating your .mpg files.
  138. ==========================================================================================================
  139. mencoder arquivo.avi -of mpeg -oac mp3lame -ovc lavc -lavcopts vcodec=msmpeg4:vbitrate -vf lavcdeint,scale -zoom -xy 352 -o arquivo.mpg
  140.  
  141.  
  142.  
  143. $ oggenc -q 9 filtered.wav
  144. ==========================================================================================================
  145. Baixar video no youtube
  146.  
  147. youtube-dl -F url
  148. youtube-dl -cwt -f 22 url
  149.  
  150. ==========================================================================================================
  151. Apagar arquivos
  152. find / -iname nome-do-arquivo.txt -exec rm -f '{}' \;
  153.  
  154. ==========================================================================================================
  155.  
  156. Converter PDF to JPG
  157.  
  158. Basically:
  159. Code:
  160. convert -geometry 600  -quality 90 -myfile.pdf myfile.jpg
  161. or enhance it with:
  162.  
  163. Code:
  164. convert -geometry 600  -quality 90 -unsharp 0.7x1.1+2.0+0 nhk.pdf nhk.jpg
  165. 600 pixels is pretty small. With this conversion I converted a pdf document in 10pt font, and it is perfectly legible.
  166. Convert is a part of the ImageMagick suite.
  167.  
  168. Additonally, you could cut the margins off the sides while converting. Showing white margins does add to the size, but not to the information. It is done with ImageMagick convert as well.
  169.  
  170. convert -geometry 800 -shave 100x0 -quality 90 myfile.pdf myfile.jpg
  171.  
  172. This will first convert the picture to a width of 800 px, and then shave 100 px off at each side
  173.  
  174. I think, I have now the parameters for the best output from my pdf-files:
  175. -----------
  176. convert -trim -posterize 9 +matte -geometry 650 -linewidth 1 -identify -enhance +dither -colors 16 +contrast +contrast -density 88 -black-point-compensation -quality 100 -unsharp 0.7x1.1+2.0+0 2.pdf 2.jpg
  177. -----------
  178.  
  179. very helpful parameters:
  180.  
  181. -trim: crops white margins
  182. -geometry: works perfectly
  183. -colors 16: I don't need all colors, because I have only text in tables
  184.  
  185. ===========================================================================================================================================================
  186.  
  187. Criar a imagem do HD de origem e armazená-lo no HD externo:
  188. # dd if=/dev/sda conv=sync,noerror bs=64K > /mnt/sda.img
  189.  
  190. Para recuperar a imagem:
  191. # dd if=/mnt/sda.img of=/dev/sda conv=sync,noerror bs=64k
  192.  
  193. Clonar o HD físico em /dev/sda para o outro hd físico em /dev/sdb:
  194. dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror
  195.  
  196. dd if=/dev/hda6 of=/dev/hda6/backup.iso
  197.  
  198.  
  199. $ dd if=/dev/sr0 of=archbang-2011.11-i686.iso
  200. sudo dd if=archbang-2011.11-i686.iso of=/dev/sdd bs=8MB
  201.  
  202. ===========================================================================================================================================================
  203. Converter e splitar flac em mp3lame
  204.  
  205. shntool split <yourflacfile> -f <yourcuefile> -t '%n - %t' -o 'cust ext=mp3 lame --quiet -V 2 --vbr-new - %f'
  206.  
  207. cuebreakpoints cue | shnsplit -o flac The\ Donnas\ -\ Gold\ Medal\ \(japanese\ edition\)\ \(2004\).flac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement