export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
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
| #!/bin/bash | |
| # Vorhandensein der Programme prüfen | |
| MKISOFS=( $(which genisoimage mkisofs) ) | |
| if ! [ -x "$MKISOFS" ]; then echo "genisoimage aka mkisofs is missing"; exit 1; fi | |
| if ! [ -x "$(which gcc)" ]; then echo "gcc is missing"; exit 1; fi | |
| if ! [ -x "$(which nasm)" ]; then echo "nasm is missing"; exit 1; fi | |
| if ! [ -x "$(which cpio)" ]; then echo "cpio is missing"; exit 1; fi | |
| if ! [ -x "$(which tar)" ]; then echo "tar is missing"; exit 1; fi |
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
| #!/bin/bash | |
| set -euo pipefail | |
| openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem | |
| openssl rsa -in privkey.pem -passin pass:abcd -out server.key | |
| openssl req -x509 -in server.req -text -key server.key -out server.crt | |
| chmod 600 server.key | |
| test $(uname -s) = Linux && chown 70 server.key | |
| docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key |
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
| ##https://stackoverflow.com/questions/5874317/thread-safe-listt-property | |
| public class ThreadSafeList<T> : IList<T> | |
| { | |
| protected List<T> _interalList = new List<T>(); | |
| // Other Elements of IList implementation | |
| public IEnumerator<T> GetEnumerator() | |
| { | |
| return Clone().GetEnumerator(); |
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
| #!/bin/bash | |
| cd ~ | |
| read -s -p 'Sudo password: ' PASSWORD | |
| echo "" | |
| echo "Configuring server..." | |
| read -p "What's the hostname of this machine? " NEW_HOSTNAME | |
| echo $PASSWORD | sudo -Sk hostnamectl set-hostname $NEW_HOSTNAME | |
| sudo sed -i -e "s/^127.0.0.1.*$/127.0.0.1 localhost $NEW_HOSTNAME/g" /etc/hosts | |
| sudo dpkg-reconfigure tzdata | |
| sudo service cron restart |
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.
Sources : MDN - HTTP Access Control | Wiki - CORS
CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:
Access-Control-Allow-Origin
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
| // Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3. | |
| #![feature(ordering_chaining, step_by)] | |
| fn main() { | |
| // linq5: Where - Indexed | |
| /* | |
| //c# | |
| public void Linq5() | |
| { |
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
| #Installing VirtualBox | |
| echo "Installing VirtualBox........................" | |
| sudo apt-get install virtualbox | |
| #Installing kubectl https://kubernetes.io/docs/getting-started-guides/kubectl/ | |
| echo "Installing kubectl..........................." | |
| wget https://storage.googleapis.com/kubernetes-release/release/v1.4.4/bin/linux/amd64/kubectl | |
| chmod +x kubectl | |
| sudo mv kubectl /usr/local/bin/kubectl |
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
| function deleteSavedItems() { | |
| var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]") | |
| if (query.length) { | |
| query[0].click(); | |
| } | |
| if (query.length > 1) { | |
| setTimeout(deleteSavedItems,100); | |
| } | |
| else { | |
| console.log('Finished'); |
This guide is based on the hibernate article from the Arch wiki.
- edit
/etc/default/gruband addresumeas well asresume_offsetkernel parametersresume=UUID=abcd-efghcontains the UUID of the partition on which the swapfile resides. In most cases theswapfileresides inroot, to identify therootparition's UUID runblkidorlsblk -O.resume_offset=1234is the offset of the swapfile from the partition start. The offset is the first entry in thephysical_offsetcolumn of the output offilefrag -v /swapfile.- update grub:
grub-mkconfig -o /boot/grub/grub.cfg - example:
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=75972c96-f909-4419-aba4-80c1b74bd605 resume_offset=1492992"
- add the
resumemodule hook to/etc/mkinitcpio.conf:HOOKS="base udev resume autodetect ...
- rebuild the initramfs
mkinitcpio -p linux