How do I configure PTP Timescale in LinuxPTP - linux

I'm having the same issue as this question, but no one has solved it yet:
Configure PTP_Timescale parameter
In Wireshark, from the master side, I am seeing Sync and Followup Messages being sent, but under the flags section of the PTP Message, only PTP_TWO_STEP is 1. The rest of the flags are 0. It looks like this:
flags: 0x0200
0... .... .... .... = PTP_SECURITY: False
.0.. .... .... .... = PTP profile Specific 2: False
..0. .... .... .... = PTP profile Specific 1: False
.... .0.. .... .... = PTP_UNICAST: False
.... ..1. .... .... = PTP_TWO_STEP: True
.... ...0 .... .... = PTP_ALTERNATE_MASTER: False
.... .... ..0. .... = FREQUENCY_TRACEABLE: False
.... .... ...0 .... = TIME_TRACEABLE: False
.... .... .... 0... = PTP_TIMESCALE: False
.... .... .... .0.. = PTP_UTC_REASONABLE: False
.... .... .... ..0. = PTP_LI_59: False
.... .... .... ...0 = PTP_LI_61: False
I use pmc to set the GM settings on the GM, in a different tab using:
sudo pmc -u -b 0 -t 1 "SET GRANDMASTER_SETTINGS_NP clockClass 248 \
clockAccuracy 0xfe offsetScaledLogVariance 0xffff \
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \
ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 \
timeSource 0xa0"
But, when I restart ptp4l and phc2sys, and look at the packets being sent in Wireshark, I don't see the changes I made reflected in the flags. Any ideas?

Related

Controlled folder access blocked imager but no notifications from Windows defender in notification bar

I was attempting to use the Raspberry Pi imager - and it kept failing, it is a 32GB drive so I had to use the erase first or manually format as FAT32 -
I found I could format the drive using the Storage manager , or on oher machines but then the attempt by the Raspberry Pi imager to erase or put an image on would overwrite the partition information , indicated by loss of all data on the disk , but then would fail soon after .
After a few attempts the Imager said it appears SecureFolderAccess is enabled .... (I dont know why it didnt always tell me ) so I ran the command
Set-MpPreference -EnableControlledFolderAccess Disabled
and it now works
The feature seems like a good idea and I'm sure I'll work out how to add the imager to the list of allowed application
However what I would like is for Windows Defender Notifications of this failure to be appear. Is this possible?
This is my current setting - theres a lot and a few are just numbers so I'm not sure what to change
AllowNetworkProtectionOnWinServer : False AttackSurfaceReductionOnlyExclusions :
AttackSurfaceReductionRules_Actions :
AttackSurfaceReductionRules_Ids :
CheckForSignaturesBeforeRunningScan : False CloudBlockLevel
: 0 CloudExtendedTimeout : 0 ComputerID
: 69274C2A-8D4B-4583-AFC5-B652445A8C19
ControlledFolderAccessAllowedApplications : {C:\Program Files
(x86)\Common
Files\Acronis\TrueImageHome\TrueImageHomeService.exe}
ControlledFolderAccessProtectedFolders : DisableArchiveScanning
: False DisableAutoExclusions : False
DisableBehaviorMonitoring : False
DisableBlockAtFirstSeen : False
DisableCatchupFullScan : True
DisableCatchupQuickScan : True
DisableCpuThrottleOnIdleScans :
DisableDatagramProcessing : False
DisableEmailScanning : True
DisableIntrusionPreventionSystem : DisableIOAVProtection
: False DisablePrivacyMode : False
DisableRealtimeMonitoring : False
DisableRemovableDriveScanning : True
DisableRestorePoint : True
DisableScanningMappedNetworkDrivesForFullScan : True
DisableScanningNetworkFiles : False
DisableScriptScanning : False
EnableControlledFolderAccess : 0
EnableFileHashComputation : False
EnableLowCpuPriority : False
EnableNetworkProtection : 0 ExclusionExtension
: ExclusionIpAddress : ExclusionPath
: ExclusionProcess : {C:\Program Files
(x86)\Common
Files\Acronis\TrueImageHome\TrueImageHomeService.exe}
HighThreatDefaultAction : 0
LowThreatDefaultAction : 0 MAPSReporting
: 2 MeteredConnectionUpdates : False
ModerateThreatDefaultAction : 0 PUAProtection
: 0 QuarantinePurgeItemsAfterDelay : 90
RandomizeScheduleTaskTimes : True
RealTimeScanDirection : 0
RemediationScheduleDay : 0
RemediationScheduleTime : 02:00:00
ReportingAdditionalActionTimeOut : 10080
ReportingCriticalFailureTimeOut : 10080
ReportingNonCriticalTimeOut : 1440
ScanAvgCPULoadFactor : 50
ScanOnlyIfIdleEnabled : True ScanParameters
: 1 ScanPurgeItemsAfterDelay : 15 ScanScheduleDay
: 0 ScanScheduleQuickScanTime : 00:00:00
ScanScheduleTime : 02:00:00
SevereThreatDefaultAction : 0 SharedSignaturesPath
: SignatureAuGracePeriod : 0
SignatureBlobFileSharesSources :
SignatureBlobUpdateInterval : 60
SignatureDefinitionUpdateFileSharesSources :
SignatureDisableUpdateOnStartupWithoutEngine : False
SignatureFallbackOrder :
MicrosoftUpdateServer|MMPC SignatureFirstAuGracePeriod
: 120 SignatureScheduleDay : 8
SignatureScheduleTime : 01:45:00
SignatureUpdateCatchupInterval : 1
SignatureUpdateInterval : 0 SubmitSamplesConsent
: 1 ThreatIDDefaultAction_Actions :
ThreatIDDefaultAction_Ids : UILockdown
: False UnknownThreatDefaultAction : 0
PSComputerName :
My experience with Controlled Folder Access has been less than stellar; most tragically it's stopped game saves for hours of gameplay. I was constantly whitelisting, and I remember it stopping USOCoreWorker (Windows update exe) from doing its job during updates. I disabled it in favour of enabling other Defender options. Also backups and keep it in the cloud.
As far as I understand, it's intended for business use where you won't be seeing a lot of new apps/random events.
what OS version are you running? I ask as it might have improved since the last feature update.

Docker inside LXC unprivileged container

I am trying to run Docker containers inside LXC unprivileged container. Can anyone suggest what am I missing?
If I remove apparmor from the LXC container it works fine. Seems like I need to do some apparmor magic to make it work without disabling apparmor?
This is my current LXC container config:
lxc.include = /usr/share/lxc/config/nesting.conf
# Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
# For Ubuntu 14.04
lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0
lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0
lxc.include = /usr/share/lxc/config/userns.conf
# For Ubuntu 14.04
lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0
lxc.arch = linux64
# Container specific configuration
lxc.idmap = u 0 1258512 65536
lxc.idmap = g 0 1258512 65536
lxc.rootfs.path = dir:/var/lib/lxc/ubuntu/rootfs
lxc.uts.name = ubuntu
# Network configuration
lxc.net.0.type = veth
lxc.net.0.link = br0
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:3e:3f:77
lxc.net.0.ipv4.address = 10.0.3.242/24
lxc.net.0.ipv4.gateway = auto
lxc.cgroup.memory.limit_in_bytes = 512M
lxc.cgroup.cpuset.cpus = 0-31
lxc.start.auto = 1
Is the following in the config helpful in resolving:
lxc.aa_profile = unconfined
It may break your security profile, but may get you started in the right direction.

How do I use pwm-beeper module in Linux Kernel?

I have set my PWM driven beeper up as per the Linux device tree documentation. I see that this results in an extra input device in /sys/class/input:
root:/sys/class/input/input0# ls
capabilities device event0 id modalias name phys power properties subsystem uevent uniq
root:/sys/class/input/input0# cat name
pwm-beeper
However, I don't see anything related to the duty cycle, polarity etc to actually control the beeper. Perhaps I am very mistaken about pwm-beeper as it is clearly created as an input device. Please help!
[update]
Changes in my dts:
pwm15: dmtimer-pwm#15 {
compatible = "ti,omap-dmtimer-pwm";
ti,timers = <&timer15>;
#pwm-cells = <3>;
};
beeper: pwm-beeper {
compatible = "pwm-beeper";
pwms = <&pwm15 0 5000>;
volume-levels = <0 8 20 40 500>;
default-volume-level = <4>;
};
Relevant dmesg:
[ 6.716560] OF: /pwm-beeper: arguments longer than property
[ 6.716566] of_pwm_get(): can't parse "pwms" property
[ 6.716574] pwm-beeper pwm-beeper: Failed to request PWM device:
-22
[ 6.716590] pwm-beeper: probe of pwm-beeper failed with error -22
I am utterly confused because there is just so little info about this device driver mainlined in Linux!
can you post snippet of DT block you have added?
try this block
pwm-beeper {
compatible = "pwm-beeper";
pwms = <&pwm4 0 5000>;
volume-levels = <0 8 20 40 500>;
default-volume-level = <4>;
};
Update 1
TLDR; either reduce you #pwm-cells to 2
Or add one more field i.e. third field to list
like
pwms = <&pwm4 0 5000 1>;
phandle1: node1 {
#list-cells = <2>;
}
phandle2: node2 {
#list-cells = <1>;
}
node3 {
list = <&phandle1 1 2 &phandle2 3>;
}
here notice list has #list-cells differant
phadle1 has 2
phadle2 has 1
so accordingly list has entries.
This will work
whats you linux version ? can you test it on latest stable ?

TinyX shows display using builtin fbtft touchscreen driver but touch doesn't work

I'm using an "adafruitts" touchscreen with a raspi to control a usb peripheral.
The full raspbian kernel takes forever to boot (50 seconds), and part of that is due to the touchscreen driver loading (by modprobe/udev) and initializing.
During the first 20-30 seconds of boot, the display is not loaded, so it is blank. I need this to be a user-friendly item that cannot be blank for 30 seconds each time it is turned on, so I've used buildroot to build a small kernel with the touchscreen driver built-in. (I am on a steep learning curve with buildroot and kernel building in general).
The display driver is fbtft_device.c patched to include the adafruitts display. This patch defines the "touch" half:
/* Touch device spi-half of adafruit touchscreen */
.name = "adafruitts",
.spi = &(struct spi_board_info) {
.modalias = "stmpe610",
.max_speed_hz = 500000,
.mode = SPI_MODE_0,
.chip_select = 1,
.platform_data = &(struct stmpe_platform_data) {
.blocks = STMPE_BLOCK_TOUCHSCREEN | STMPE_BLOCK_GPIO,
.irq_over_gpio = 1,
.irq_gpio = 24,
.irq_trigger = IRQF_TRIGGER_FALLING,
.irq_base = GPIO_IRQ_START + GPIO_IRQS,
.ts = &(struct stmpe_ts_platform_data) {
.sample_time = 4,
.mod_12b = 1,
.ref_sel = 0,
.adc_freq = 2,
.ave_ctrl = 3,
.touch_det_delay = 4,
.settling = 2,
.fraction_z = 7,
.i_drive = 0,
},
}
},
.is_support = 1,
.gpio_settings = (struct gpio_setting []) {
{
.gpio = 24,
.pull = pull_up,
}
},
.gpio_num_settings = 1,
},
and the LCD half:
}, {
/* LCD component of adafruit touchscreen */
.name = "adafruitts",
.spi = &(struct spi_board_info) {
.modalias = "fb_ili9340",
.max_speed_hz = 16000000,
.mode = SPI_MODE_0,
.chip_select = 0,
.platform_data = &(struct fbtft_platform_data) {
.display = {
.buswidth = 8,
.backlight = 1,
},
.bgr = true,
.gpios = (const struct fbtft_gpio []) {
{ "dc", 25 },
{},
},
}
}
}, {
by including:
fbtft_device.name=adafruitts
in the cmdline.txt for the boot loader, I've gotten the display half of the system to work (it boots in ~ 5 seconds :) ) with tinyX/matchbox desktop showing the desktop, but I cannot get the touchscreen part to work (the cursor does not move when I touch the screeen).
Somehow I have to bind the touch part of the touchscreen to tinyX, but I have not been able to figure out how to do this.
I have tried to specify the keyboard (and mouse) when launching tinyX:
X -keybd smpte610 (for example)
but X reports it cannot find the driver.
How can I verify the touch screen input device was successfully loaded?
The boot log has these messages about fbtft_device:
fbtft_device: SPI devices registered:
fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
fbtft_device: 'fb' Platform devices registered:
fbtft_device: bcm2708_fb id=-1 pdata? no
fbtft_device: Deleting spi0.1 (spi0.1)
fbtft_device: Looking at item 0
fbtft_device: Setting pin 24 to 2
stmpe-spi: probe of spi0.1 failed with error -22
fbtft_device: Deleting spi0.0 (spi0.0)
Console: switching to colour frame buffer device 40x30
graphics fb0: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=20, spi0.0 at 16 MHz
fbtft_device: GPIOS used by 'adafruitts':
fbtft_device: 'dc' = GPIO25
fbtft_device: SPI devices registered:
fbtft_device: stmpe610 spi0.1 48000kHz 8 bits mode=0x00
fbtft_device: fb_ili9340 spi0.0 16000kHz 8 bits mode=0x00
kgdb: Registered I/O driver kgdboc.
Is the kgdb message associated with fbtft_device or something else?
If I look in /dev/input I see: event0, event1, and mice. event0 and event1 are associated with an attached keyboard (according to the boot log) and I have no mouse attached. Should there be some other items in input?
If the touch screen input device IS loaded, how to I specify the correct driver for tinyX?
Thanks
What I learned:
By comparing the boot messages in my modprobe/udev/module loading kernel with the fast built-in kernel, it shows:
stmpe-spi: probe of spi0.1 failed with error -22
is a "bad" thing.
A successful driver load will say (something like):
bcm2708_spi.0: registered child spi0.0
and then later:
input: stmpe-ts as /devices/virtual/input/input0
I fixed the "probe" failure by making these changes to my kernel configuration file. (Sorry, I don't want to include the whole thing, so these are the changes from when I had the issue to when the driver successfully loaded according to the syslog):
< Touch Did Not respond > Touch Did respond
> CONFIG_INPUT_FF_MEMLESS=y
< CONFIG_INPUT_POLLDEV=m > CONFIG_INPUT_POLLDEV=y
< CONFIG_INPUT_EVDEV=m > CONFIG_INPUT_EVDEV=y
< CONFIG_TOUCHSCREEN_STMPE=m > CONFIG_TOUCHSCREEN_STMPE=y
> CONFIG_KEYBOARD_STMPE=y
< CONFIG_SERIO=m > CONFIG_SERIO_SERPORT=m
> CONFIG_SPI_DEBUG=y
< CONFIG_SPI_SPIDEV=y
> CONFIG_SPI_GPIO=y
My main objective with these changes was to try to make sure that the dependent drivers were also built-in, and I enabled the debug. (Some of these were magically set by menuconfig, and this is diff from the "non-default" values from buildroot, so the diff is - different)
With this config, I now have event0, event1, event2, mice, and mouse0. The syslog says event1 and event2 are associated with the usb keyboard I have attached. I have no extra mouse attached.
I could use "evtest" to see events from /dev/input/event0 whenever I touched the display. evtest'ing /dev/input/mouse0 threw "Inappropriate ioctl for device"
I restarted X (tinyX) using:
X -mouse mouse,,/dev/input/mouse0
and touches worked, but the touch axis is rotated from the display axis.
I could not figure out a way to fix this in tinyX, so I'm going with a full blown Xorg implementation.
Make sure you have enabled the evdev input support in tinyx (BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE_EVDEV) and use the syntax specified in hw/kdrive/src/kinput.c:
/*
* You can call your kdriver server with something like:
* $ ./hw/kdrive/yourserver/X :1 -mouse evdev,,device=/dev/input/event4 -keybd
* evdev,,device=/dev/input/event1,xkbmodel=abnt2,xkblayout=br
*/

Ghostscript and Pantone/spotcolors

I have some pdf's for professional print that are put in a certain folder. These pdf's may or may not contain spot/Pantone colors. All files in this folder get processed.
I have to cut some white space from the edges and this works fine with Ghostscript 8.7 on a linux machine using the command:
gs \
-o correct_size.pdf \
-sDEVICE=pdfwrite \
-g1000x1000 \
-dPDFSETTINGS=/prepress \
-c "<</PageOffset [0 0]>> setpagedevice" \
-f original_size.pdf
This problem is the spot/Pantone colors aren't preserved.
The documentation speaks about handling spotcolors but doesn't really give a solution.
Has anyone come across this before or does anyone have another solution? It doesn't have to involve Ghostscript.
Using a version of Ghostscript less than 5 years old would be a good place to start!
The current version of pdfwrite will retain colour spaces, including Separation (what you are calling spot) ICCBased and DeviceN. It is also capable of retaining Separation colour spaces when converting to a different device space, by resampling the tint transform into the desired space.
Secondly, don't use the canned PDFSETTINGS unless you are very sure you understand what the settings mean. In general the default settings in pdfwrite will preserve unchanged anything in the original file that it can, the PDFSETTINGS are set to follow (as far as possible) the same settings in Adobe Acrobat Distiller. If you aren't certain what these do, the documentation details it.
If you want to know exactly, what the canned -dPDFSETTINGS=/prepress do, you can query your current version of Ghostscript with this command:
gs -q \
-dPDFSETTINGS=/prepress \
-o /dev/null \
-sDEVICE=pdfwrite \
-c "currentpagedevice {exch ==only ( ) print == } forall" \
| sort
In my case, I get this for a Ghostscript 9.16 (self-compiled from Ghostscript's current Git source respository):
/%MediaDestination 0
/%MediaSource 0
/.AlwaysEmbed []
/.HWMargins [0.0 0.0 0.0 0.0]
/.IgnoreNumCopies false
/.LockSafetyParams false
/.MarginsHWResolution [720.0 720.0]
/.MediaSize [612.0 792.0]
/.NeverEmbed []
/ASCII85EncodePages false
/AllowIncrementalCFF false
/AllowPSRepeatFunctions false
/AlwaysEmbed []
/AntiAliasColorImages false
/AntiAliasGrayImages false
/AntiAliasMonoImages false
/AutoFilterColorImages true
/AutoFilterGrayImages true
/AutoPositionEPSFiles true
/AutoRotatePages /None
/BandBufferSpace 0
/BandHeight 0
/BandWidth 0
/BeginPage {--.callbeginpage--}
/Binding /Left
/BitsPerPixel 24
/BlackPtComp 8
/BlueValues 256
/BufferSpace 4000000
/CalCMYKProfile (None)
/CalGrayProfile (None)
/CalRGBProfile (None)
/CannotEmbedFontPolicy /Error
/CenterPages false
/ColorACSImageDict -dict-
/ColorAutoFilterStrategy 248456437
/ColorConversionStrategy /LeaveColorUnchanged
/ColorImageDepth -1
/ColorImageDict -dict-
/ColorImageDownsampleThreshold 1.5
/ColorImageDownsampleType /Bicubic
/ColorImageFilter /DCTEncode
/ColorImageResolution 300
/ColorValues 16777216
/Colors 3
/CompatibilityLevel 1.5
/CompressEntireFile false
/CompressFonts true
/CompressPages true
/ConvertCMYKImagesToRGB false
/ConvertImagesToIndexed true
/CoreDistVersion 5000
/CreateJobTicket true
/DSCEncodingToUnicode []
/DefaultRenderingIntent /Default
/DetectBlends true
/DetectDuplicateImages true
/DeviceGrayToK true
/DeviceLinkProfile ()
/DoNumCopies false
/DoThumbnails true
/DocumentTimeSeq 0
/DocumentUUID ()
/DownsampleColorImages true
/DownsampleGrayImages true
/DownsampleMonoImages true
/EmbedAllFonts true
/EmitDSCWarnings false
/EncodeColorImages true
/EncodeGrayImages true
/EncodeMonoImages true
/EncryptionR 0
/EndPage {--.callendpage--}
/FastWebView false
/FirstObjectNumber 1
/FirstPage 0
/FitPages false
/ForOPDFRead false
/GraphicBlackPt 8
/GraphicICCProfile ()
/GraphicIntent 8
/GraphicKPreserve 8
/GraphicsAlphaBits 1
/GrayACSImageDict -dict-
/GrayAutoFilterStrategy 248456437
/GrayDetection false
/GrayImageDepth -1
/GrayImageDict -dict-
/GrayImageDownsampleThreshold 1.5
/GrayImageDownsampleType /Bicubic
/GrayImageFilter /DCTEncode
/GrayImageResolution 300
/GrayValues 256
/GreenValues 256
/HWResolution [720.0 720.0]
/HWSize [6120 7920]
/HaveCIDSystem false
/HaveTransparency true
/HaveTrueTypes true
/HighLevelDevice true
/ICCOutputColors ()
/ImageBlackPt 8
/ImageICCProfile ()
/ImageIntent 8
/ImageKPreserve 8
/ImageMemory 524288
/ImagingBBox null
/InputAttributes -dict-
/Install {--.callinstall--}
/InstanceUUID ()
/IsDistiller true
/KPreserve 8
/KeyLength 0
/LZWEncodePages false
/LastPage 0
/Margins [0.0 0.0]
/MaxBitmap 10000000
/MaxClipPathSize 12000
/MaxInlineImageSize 4000
/MaxPatternBitmap 0
/MaxSeparations 3
/MaxShadingBitmapSize 256000
/MaxSubsetPct 100
/MonoImageDepth -1
/MonoImageDict -dict-
/MonoImageDownsampleThreshold 1.5
/MonoImageDownsampleType /Bicubic
/MonoImageFilter /CCITTFaxEncode
/MonoImageResolution 1200
/Name (pdfwrite)
/NeverEmbed []
/NoEncrypt ()
/NoOutputFonts false
/NoT3CCITT false
/NumCopies null
/OPM 1
/OffOptimizations 0
/Optimize true
/OutputAttributes -dict-
/OutputDevice /pdfwrite
/OutputFile (/dev/null)
/OutputICCProfile (default_rgb.icc)
/OwnerPassword ()
/PDFA 0
/PDFACompatibilityPolicy 0
/PDFEndPage -1
/PDFStartPage 1
/PDFUseOldCMS false
/PDFX false
/PDFXBleedBoxToTrimBoxOffset [0.0 0.0 0.0 0.0]
/PDFXSetBleedBoxToMediaBox true
/PDFXTrimBoxToMediaBoxOffset [0.0 0.0 0.0 0.0]
/PageCount 0
/PageDeviceName null
/PageOffset [0 0]
/PageSize [612.0 792.0]
/PageUsesTransparency false
/ParseDSCComments true
/ParseDSCCommentsForDocInfo true
/PatternImagemask false
/Permissions -4
/Policies -dict-
/PreBandThreshold false
/PreserveCopyPage true
/PreserveDeviceN true
/PreserveEPSInfo true
/PreserveHalftoneInfo false
/PreserveOPIComments true
/PreserveOverprintSettings true
/PreserveSMask true
/PreserveSeparation true
/PreserveTrMode true
/PrintStatistics false
/ProcessColorModel /DeviceRGB
/ProduceDSC true
/ProofProfile ()
/ReAssignCharacters true
/ReEncodeCharacters true
/RedValues 256
/RenderIntent 8
/RotatePages false
/SeparationColorNames []
/Separations false
/SetPageSize true
/SimulateOverprint true
/SubsetFonts true
/TextAlphaBits 1
/TextBlackPt 8
/TextICCProfile ()
/TextIntent 8
/TextKPreserve 8
/TransferFunctionInfo /Preserve
/UCRandBGInfo /Preserve
/UseCIEColor false
/UseFastColor false
/UseFlateCompression true
/UsePrologue false
/UserPassword ()
/WantsToUnicode true
/sRGBProfile (None)
If you want to use -dPDFSETTINGS=/prepress, but with some tweaks of your own, you can look up the known parameters and their canned values with above command.
Then add a suitable -c ".setpdfwrite << ... >> setdistillerparams" modification to your Ghostscript command (example is arbitrary):
gs \
-dPDFSETTINGS=/prepress \
-o out.pdf \
-sDEVICE=pdfwrite \
[...more commandline switches...] \
-c ".setpdfwrite<</Optimize false/NeverEmbed[/Courier/Verdana]>>setdistillerparams" \
-f input.pdf

Resources