Shared Hosting | Dedicated Hosting |
---|---|
1. Shared Resources | 1. Dedicated Resources |
2. Cheap than Dedicated | 2. Costlier than Dedicated |
3. Mostly no root access | 3. Root access available |
4. Less control over resources and software | 4. More control over resources and software |
5. No custom software as they are shared by everyone | 5. We can have custom software as there is no sharing |
6. Good for small projects/testing sites and web apps | 6. Good for large-scale and enterprise web apps and sites |
7. Most storage is Hard Disk Drives | 7. Storage is mostly SSD |
8. No Customizable environment | 8. Customizable environment |
This file contains 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
Url imageUrl = new Url("https://site.com/image.jpeg"); // Sample url, replace with yours | |
String destinationFile = "sample.jpg"; | |
/*******************Multipart Upload Method********************************* | |
** To resources like minio or DB | |
***************************************************************************/ | |
/******** | |
* Step 1 |
This file contains 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
version: '3.1' | |
services: | |
postgres-server: # The Postgres Database Service | |
image: postgres:latest | |
restart: always | |
environment: # Username, password and database name variables | |
POSTGRES_USER: zabbix | |
POSTGRES_PASSWORD: zabbix | |
POSTGRES_DB: zabbix | |
PG_DATA: /var/lib/postgresql/data/pgdata #data storage |
This file contains 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
/********** | |
* Here is a method showing use of OkHttp for posting a multipart form data | |
* | |
* Here RPResumeResponseDTO is a custom DTO being used in the project | |
* For taking file from rest api endpoint we are using as a multipart file parameter | |
**********/ | |
/**************Steps *******************/ | |
RPResumeResponseDTO postResumeToRPServer(MultipartFile file) throws IOException { | |
log.debug("Request to post file : {}",file.getOriginalFilename()); |
This file contains 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
// authorization code and tokens | |
authorizationCode: string; | |
oAuthToken: string; | |
oAuthVerifier: string; | |
// popup related | |
private windowHandle: Window; // reference to the window object we will create | |
private intervalId: any = null; // For setting interval time between we check for authorization code or token | |
private loopCount = 600; // the count until which the check will be done, or after window be closed automatically. | |
private intervalLength = 100; // the gap in which the check will be done for code. |
This file contains 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
public Map<String, String> getKeyValueRelationShipByBlocks(List<Block> blocks) { | |
Map<String, Map<String, Block>> keyValueBlockMap = getKeyValueBlockMap(blocks); | |
getKeyValueRelationShip(keyValueBlockMap); | |
return null; | |
} | |
Block findValueBlock(Block keyBlock, Map<String, Block> valueMap) { | |
log.debug("Find value Block "); | |
Block valueBlock = null; |
This file contains 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
<script src="./example.js"></script> | |
<script> | |
async function someMethod() { | |
const res = window.Buffer.from('somestring'); | |
} | |
</script> |
This file contains 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
/***Imports ****/ | |
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; | |
import org.bouncycastle.openssl.PEMParser; | |
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; | |
import java.security.PrivateKey; | |
import java.security.PublicKey; | |
import io.jsonwebtoken.JwsHeader; | |
import io.jsonwebtoken.Jwts; | |
import io.jsonwebtoken.SignatureAlgorithm; | |
import java.util.Date; |
This file contains 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
Convert a video to Mp4(MPEG-4 AVC) and AAC audio | |
/* Step 1. Declaring source file and Target file */ | |
File source = new File("source.avi"); | |
File target = new File("target.mp4"); | |
/* Step 2. Set Audio Attrributes for conversion*/ | |
AudioAttributes audio = new AudioAttributes(); | |
audio.setCodec("aac"); | |
// here 64kbit/s is 64000 |
NewerOlder