This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Google Chrome as well as Mozilla Firerfox both provide an option to copy download link specifically for cURL. This option will generate cURL with all required things such as User agent for downloading things from the side. To get that, | |
1. Open the URL in either of the browser. | |
2. Open Developer options using Ctrl+Shift+I. | |
3. Go to Network tab. | |
4. Now click on download. Saving file isn't required. We only need the network activity while browser requests the file from the server. | |
5. A new entry will appear which would look like "download.aspx?...". | |
6. Right click on that and Copy → Copy as cURL. | |
7. Paste the copied content directly in the terminal and append --output file.extension to save the content in file.extension since terminal isn't capable of showing binary data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert_to_rgb_array(channel: numpy.ndarray, rgb_base: Tuple[int, int, int], alpha: None | float | int | numpy.ndarray = None, | |
mode: Literal['RGB', 'RGBA'] = 'RGB') -> numpy.ndarray: | |
""" | |
Parameters | |
---------- | |
channel: numpy.ndarray | |
A 2D floating-point array with values in the range [0, 1] | |
rgb_base: Tuple[int,int,int] | |
A single rgb color which will be used as the base color of the array. | |
The resulting color of each pixel is generated by multiplying the pixel value by `rgb_base`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install packages suggested by apt when install a program. | |
apt-get -o APT::Install-Suggests="true" install {package} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Take a look @ mp3gain which for me is even better than normalize-audio | |
mp3gain -r *.mp3 | |
another useful version could be the -c which prevent to ask if you want to do the changes for many files: | |
mp3gain -c -r *.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Size in memory of a numpy array | |
array_size = array.size | |
array_itemsize = array.itemsize | |
array_total = array_size * array_itemsize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add padding to a figure after the plot is generated | |
plt.gcf().subplots_adjust(left = 0.30) | |
########################### Change grid spacing ################################ | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download all links within an rss file | |
```cat rss.xml | tr "\"\'" "\n" | grep mp3 | xargs wget``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:void(document.oncontextmenu=null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change ticklabel size | |
plt.yticks(fontsize=20) | |
ax.tick_params(axis='x', labelsize=20) | |
# Remove tick labels | |
ax.xaxis.set_visible(True) | |
ax.axis('off') | |
ax.set_axis_off() | |
ax.get_xaxis().set_visible(False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.file -map 0:a:0 -b:a 96k output.mp3 |
NewerOlder